<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.dao.system.dao.TbPlussUserAccountMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserAccount">
    <id column="user_id" jdbcType="INTEGER" property="userId" />
    <result column="freeze_balance" jdbcType="DECIMAL" property="freezeBalance" />
    <result column="balance" jdbcType="DECIMAL" property="balance" />
    <result column="out_balance" jdbcType="DECIMAL" property="outBalance" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <sql id="Base_Column_List">
    user_id, freeze_balance, balance, out_balance, create_time, update_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_account
    where user_id = #{userId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_account
    where user_id = #{userId,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAccount">
    insert into tb_pluss_user_account (user_id, freeze_balance, balance, 
      out_balance, create_time, update_time
      )
    values (#{userId,jdbcType=INTEGER}, #{freezeBalance,jdbcType=DECIMAL}, #{balance,jdbcType=DECIMAL}, 
      #{outBalance,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAccount">
    insert into tb_pluss_user_account
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="userId != null">
        user_id,
      </if>
      <if test="freezeBalance != null">
        freeze_balance,
      </if>
      <if test="balance != null">
        balance,
      </if>
      <if test="outBalance != null">
        out_balance,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="userId != null">
        #{userId,jdbcType=INTEGER},
      </if>
      <if test="freezeBalance != null">
        #{freezeBalance,jdbcType=DECIMAL},
      </if>
      <if test="balance != null">
        #{balance,jdbcType=DECIMAL},
      </if>
      <if test="outBalance != null">
        #{outBalance,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAccount">
    update tb_pluss_user_account
    <set>
      <if test="freezeBalance != null">
        freeze_balance = #{freezeBalance,jdbcType=DECIMAL},
      </if>
      <if test="balance != null">
        balance = #{balance,jdbcType=DECIMAL},
      </if>
      <if test="outBalance != null">
        out_balance = #{outBalance,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where user_id = #{userId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAccount">
    update tb_pluss_user_account
    set freeze_balance = #{freezeBalance,jdbcType=DECIMAL},
      balance = #{balance,jdbcType=DECIMAL},
      out_balance = #{outBalance,jdbcType=DECIMAL},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where user_id = #{userId,jdbcType=INTEGER}
  </update>
</mapper>