<?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.TbPlussUserAreaRewardFlowMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserAreaRewardFlow">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="roleCode" jdbcType="VARCHAR" property="rolecode" />
    <result column="areaFlow" jdbcType="DECIMAL" property="areaflow" />
    <result column="rewardAmt" jdbcType="DECIMAL" property="rewardamt" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="createDate" jdbcType="DATE" property="createdate" />
    <result column="profitDate" jdbcType="DATE" property="profitdate" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, roleCode, areaFlow, rewardAmt, createTime, createDate, profitDate
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_area_reward_flow
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_area_reward_flow
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAreaRewardFlow">
    insert into tb_pluss_user_area_reward_flow (id, userId, roleCode, 
      areaFlow, rewardAmt, createTime, 
      createDate, profitDate)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{rolecode,jdbcType=VARCHAR}, 
      #{areaflow,jdbcType=DECIMAL}, #{rewardamt,jdbcType=DECIMAL}, #{createtime,jdbcType=TIMESTAMP}, 
      #{createdate,jdbcType=DATE}, #{profitdate,jdbcType=DATE})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAreaRewardFlow">
    insert into tb_pluss_user_area_reward_flow
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="rolecode != null">
        roleCode,
      </if>
      <if test="areaflow != null">
        areaFlow,
      </if>
      <if test="rewardamt != null">
        rewardAmt,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="createdate != null">
        createDate,
      </if>
      <if test="profitdate != null">
        profitDate,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="rolecode != null">
        #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="areaflow != null">
        #{areaflow,jdbcType=DECIMAL},
      </if>
      <if test="rewardamt != null">
        #{rewardamt,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdate != null">
        #{createdate,jdbcType=DATE},
      </if>
      <if test="profitdate != null">
        #{profitdate,jdbcType=DATE},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAreaRewardFlow">
    update tb_pluss_user_area_reward_flow
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="rolecode != null">
        roleCode = #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="areaflow != null">
        areaFlow = #{areaflow,jdbcType=DECIMAL},
      </if>
      <if test="rewardamt != null">
        rewardAmt = #{rewardamt,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdate != null">
        createDate = #{createdate,jdbcType=DATE},
      </if>
      <if test="profitdate != null">
        profitDate = #{profitdate,jdbcType=DATE},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAreaRewardFlow">
    update tb_pluss_user_area_reward_flow
    set userId = #{userid,jdbcType=INTEGER},
      roleCode = #{rolecode,jdbcType=VARCHAR},
      areaFlow = #{areaflow,jdbcType=DECIMAL},
      rewardAmt = #{rewardamt,jdbcType=DECIMAL},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      createDate = #{createdate,jdbcType=DATE},
      profitDate = #{profitdate,jdbcType=DATE}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>