<?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.TbPlussUserProfitMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserProfit">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="parentId" jdbcType="INTEGER" property="parentid" />
    <result column="roleCode" jdbcType="VARCHAR" property="rolecode" />
    <result column="teamTransFlow" jdbcType="DECIMAL" property="teamtransflow" />
    <result column="ownTransFlow" jdbcType="DECIMAL" property="owntransflow" />
    <result column="directTransFlow" jdbcType="DECIMAL" property="directtransflow" />
    <result column="indirectTransFlow" jdbcType="DECIMAL" property="indirecttransflow" />
    <result column="totalProfitAmt" jdbcType="DECIMAL" property="totalprofitamt" />
    <result column="directProfitAmt" jdbcType="DECIMAL" property="directprofitamt" />
    <result column="indirectProfitAmt" jdbcType="DECIMAL" property="indirectprofitamt" />
    <result column="otherProfitAmt" jdbcType="DECIMAL" property="otherprofitamt" />
    <result column="t2ProfitAmt" jdbcType="DECIMAL" property="t2profitamt" />
    <result column="t3ProfitAmt" jdbcType="DECIMAL" property="t3profitamt" />
    <result column="dividProfitAmt" jdbcType="DECIMAL" property="dividprofitamt" />
    <result column="areaFlow" jdbcType="DECIMAL" property="areaflow" />
    <result column="areaProfitAmt" jdbcType="DECIMAL" property="areaprofitamt" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="profitDate" jdbcType="DATE" property="profitdate" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="levelCode" jdbcType="VARCHAR" property="levelcode" />
    <result column="profitMonth" jdbcType="VARCHAR" property="profitmonth" />
    <result column="transNum" jdbcType="INTEGER" property="transnum" />
    <result column="ownTransNum" jdbcType="INTEGER" property="owntransnum" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, parentId, roleCode, teamTransFlow, ownTransFlow, directTransFlow, indirectTransFlow, 
    totalProfitAmt, directProfitAmt, indirectProfitAmt, otherProfitAmt, t2ProfitAmt, 
    t3ProfitAmt, dividProfitAmt, areaFlow, areaProfitAmt, createTime, profitDate, remarks, 
    levelCode, profitMonth, transNum, ownTransNum
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_profit
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_profit
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserProfit">
    insert into tb_pluss_user_profit (id, userId, parentId, 
      roleCode, teamTransFlow, ownTransFlow, 
      directTransFlow, indirectTransFlow, totalProfitAmt, 
      directProfitAmt, indirectProfitAmt, otherProfitAmt, 
      t2ProfitAmt, t3ProfitAmt, dividProfitAmt, 
      areaFlow, areaProfitAmt, createTime, 
      profitDate, remarks, levelCode, 
      profitMonth, transNum, ownTransNum
      )
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{parentid,jdbcType=INTEGER}, 
      #{rolecode,jdbcType=VARCHAR}, #{teamtransflow,jdbcType=DECIMAL}, #{owntransflow,jdbcType=DECIMAL}, 
      #{directtransflow,jdbcType=DECIMAL}, #{indirecttransflow,jdbcType=DECIMAL}, #{totalprofitamt,jdbcType=DECIMAL}, 
      #{directprofitamt,jdbcType=DECIMAL}, #{indirectprofitamt,jdbcType=DECIMAL}, #{otherprofitamt,jdbcType=DECIMAL}, 
      #{t2profitamt,jdbcType=DECIMAL}, #{t3profitamt,jdbcType=DECIMAL}, #{dividprofitamt,jdbcType=DECIMAL}, 
      #{areaflow,jdbcType=DECIMAL}, #{areaprofitamt,jdbcType=DECIMAL}, #{createtime,jdbcType=TIMESTAMP}, 
      #{profitdate,jdbcType=DATE}, #{remarks,jdbcType=VARCHAR}, #{levelcode,jdbcType=VARCHAR}, 
      #{profitmonth,jdbcType=VARCHAR}, #{transnum,jdbcType=INTEGER}, #{owntransnum,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserProfit">
    insert into tb_pluss_user_profit
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="parentid != null">
        parentId,
      </if>
      <if test="rolecode != null">
        roleCode,
      </if>
      <if test="teamtransflow != null">
        teamTransFlow,
      </if>
      <if test="owntransflow != null">
        ownTransFlow,
      </if>
      <if test="directtransflow != null">
        directTransFlow,
      </if>
      <if test="indirecttransflow != null">
        indirectTransFlow,
      </if>
      <if test="totalprofitamt != null">
        totalProfitAmt,
      </if>
      <if test="directprofitamt != null">
        directProfitAmt,
      </if>
      <if test="indirectprofitamt != null">
        indirectProfitAmt,
      </if>
      <if test="otherprofitamt != null">
        otherProfitAmt,
      </if>
      <if test="t2profitamt != null">
        t2ProfitAmt,
      </if>
      <if test="t3profitamt != null">
        t3ProfitAmt,
      </if>
      <if test="dividprofitamt != null">
        dividProfitAmt,
      </if>
      <if test="areaflow != null">
        areaFlow,
      </if>
      <if test="areaprofitamt != null">
        areaProfitAmt,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="profitdate != null">
        profitDate,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="levelcode != null">
        levelCode,
      </if>
      <if test="profitmonth != null">
        profitMonth,
      </if>
      <if test="transnum != null">
        transNum,
      </if>
      <if test="owntransnum != null">
        ownTransNum,
      </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="parentid != null">
        #{parentid,jdbcType=INTEGER},
      </if>
      <if test="rolecode != null">
        #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="teamtransflow != null">
        #{teamtransflow,jdbcType=DECIMAL},
      </if>
      <if test="owntransflow != null">
        #{owntransflow,jdbcType=DECIMAL},
      </if>
      <if test="directtransflow != null">
        #{directtransflow,jdbcType=DECIMAL},
      </if>
      <if test="indirecttransflow != null">
        #{indirecttransflow,jdbcType=DECIMAL},
      </if>
      <if test="totalprofitamt != null">
        #{totalprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="directprofitamt != null">
        #{directprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="indirectprofitamt != null">
        #{indirectprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="otherprofitamt != null">
        #{otherprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="t2profitamt != null">
        #{t2profitamt,jdbcType=DECIMAL},
      </if>
      <if test="t3profitamt != null">
        #{t3profitamt,jdbcType=DECIMAL},
      </if>
      <if test="dividprofitamt != null">
        #{dividprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="areaflow != null">
        #{areaflow,jdbcType=DECIMAL},
      </if>
      <if test="areaprofitamt != null">
        #{areaprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="profitdate != null">
        #{profitdate,jdbcType=DATE},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="levelcode != null">
        #{levelcode,jdbcType=VARCHAR},
      </if>
      <if test="profitmonth != null">
        #{profitmonth,jdbcType=VARCHAR},
      </if>
      <if test="transnum != null">
        #{transnum,jdbcType=INTEGER},
      </if>
      <if test="owntransnum != null">
        #{owntransnum,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserProfit">
    update tb_pluss_user_profit
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="parentid != null">
        parentId = #{parentid,jdbcType=INTEGER},
      </if>
      <if test="rolecode != null">
        roleCode = #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="teamtransflow != null">
        teamTransFlow = #{teamtransflow,jdbcType=DECIMAL},
      </if>
      <if test="owntransflow != null">
        ownTransFlow = #{owntransflow,jdbcType=DECIMAL},
      </if>
      <if test="directtransflow != null">
        directTransFlow = #{directtransflow,jdbcType=DECIMAL},
      </if>
      <if test="indirecttransflow != null">
        indirectTransFlow = #{indirecttransflow,jdbcType=DECIMAL},
      </if>
      <if test="totalprofitamt != null">
        totalProfitAmt = #{totalprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="directprofitamt != null">
        directProfitAmt = #{directprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="indirectprofitamt != null">
        indirectProfitAmt = #{indirectprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="otherprofitamt != null">
        otherProfitAmt = #{otherprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="t2profitamt != null">
        t2ProfitAmt = #{t2profitamt,jdbcType=DECIMAL},
      </if>
      <if test="t3profitamt != null">
        t3ProfitAmt = #{t3profitamt,jdbcType=DECIMAL},
      </if>
      <if test="dividprofitamt != null">
        dividProfitAmt = #{dividprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="areaflow != null">
        areaFlow = #{areaflow,jdbcType=DECIMAL},
      </if>
      <if test="areaprofitamt != null">
        areaProfitAmt = #{areaprofitamt,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="profitdate != null">
        profitDate = #{profitdate,jdbcType=DATE},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="levelcode != null">
        levelCode = #{levelcode,jdbcType=VARCHAR},
      </if>
      <if test="profitmonth != null">
        profitMonth = #{profitmonth,jdbcType=VARCHAR},
      </if>
      <if test="transnum != null">
        transNum = #{transnum,jdbcType=INTEGER},
      </if>
      <if test="owntransnum != null">
        ownTransNum = #{owntransnum,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserProfit">
    update tb_pluss_user_profit
    set userId = #{userid,jdbcType=INTEGER},
      parentId = #{parentid,jdbcType=INTEGER},
      roleCode = #{rolecode,jdbcType=VARCHAR},
      teamTransFlow = #{teamtransflow,jdbcType=DECIMAL},
      ownTransFlow = #{owntransflow,jdbcType=DECIMAL},
      directTransFlow = #{directtransflow,jdbcType=DECIMAL},
      indirectTransFlow = #{indirecttransflow,jdbcType=DECIMAL},
      totalProfitAmt = #{totalprofitamt,jdbcType=DECIMAL},
      directProfitAmt = #{directprofitamt,jdbcType=DECIMAL},
      indirectProfitAmt = #{indirectprofitamt,jdbcType=DECIMAL},
      otherProfitAmt = #{otherprofitamt,jdbcType=DECIMAL},
      t2ProfitAmt = #{t2profitamt,jdbcType=DECIMAL},
      t3ProfitAmt = #{t3profitamt,jdbcType=DECIMAL},
      dividProfitAmt = #{dividprofitamt,jdbcType=DECIMAL},
      areaFlow = #{areaflow,jdbcType=DECIMAL},
      areaProfitAmt = #{areaprofitamt,jdbcType=DECIMAL},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      profitDate = #{profitdate,jdbcType=DATE},
      remarks = #{remarks,jdbcType=VARCHAR},
      levelCode = #{levelcode,jdbcType=VARCHAR},
      profitMonth = #{profitmonth,jdbcType=VARCHAR},
      transNum = #{transnum,jdbcType=INTEGER},
      ownTransNum = #{owntransnum,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>