<?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.TbPlussUserManageProfitMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserManageProfit">
    <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="levelCode" jdbcType="VARCHAR" property="levelcode" />
    <result column="t2Flow" jdbcType="DECIMAL" property="t2flow" />
    <result column="t3Flow" jdbcType="DECIMAL" property="t3flow" />
    <result column="t2Profit" jdbcType="DECIMAL" property="t2profit" />
    <result column="t3Profit" jdbcType="DECIMAL" property="t3profit" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="profitDate" jdbcType="DATE" property="profitdate" />
    <result column="profitMonth" jdbcType="VARCHAR" property="profitmonth" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, parentId, roleCode, levelCode, t2Flow, t3Flow, t2Profit, t3Profit, createTime, 
    profitDate, profitMonth, remark
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_manage_profit
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_manage_profit
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserManageProfit">
    insert into tb_pluss_user_manage_profit (id, userId, parentId, 
      roleCode, levelCode, t2Flow, 
      t3Flow, t2Profit, t3Profit, 
      createTime, profitDate, profitMonth, 
      remark)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{parentid,jdbcType=INTEGER}, 
      #{rolecode,jdbcType=VARCHAR}, #{levelcode,jdbcType=VARCHAR}, #{t2flow,jdbcType=DECIMAL}, 
      #{t3flow,jdbcType=DECIMAL}, #{t2profit,jdbcType=DECIMAL}, #{t3profit,jdbcType=DECIMAL}, 
      #{createtime,jdbcType=TIMESTAMP}, #{profitdate,jdbcType=DATE}, #{profitmonth,jdbcType=VARCHAR}, 
      #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserManageProfit">
    insert into tb_pluss_user_manage_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="levelcode != null">
        levelCode,
      </if>
      <if test="t2flow != null">
        t2Flow,
      </if>
      <if test="t3flow != null">
        t3Flow,
      </if>
      <if test="t2profit != null">
        t2Profit,
      </if>
      <if test="t3profit != null">
        t3Profit,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="profitdate != null">
        profitDate,
      </if>
      <if test="profitmonth != null">
        profitMonth,
      </if>
      <if test="remark != null">
        remark,
      </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="levelcode != null">
        #{levelcode,jdbcType=VARCHAR},
      </if>
      <if test="t2flow != null">
        #{t2flow,jdbcType=DECIMAL},
      </if>
      <if test="t3flow != null">
        #{t3flow,jdbcType=DECIMAL},
      </if>
      <if test="t2profit != null">
        #{t2profit,jdbcType=DECIMAL},
      </if>
      <if test="t3profit != null">
        #{t3profit,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="profitdate != null">
        #{profitdate,jdbcType=DATE},
      </if>
      <if test="profitmonth != null">
        #{profitmonth,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserManageProfit">
    update tb_pluss_user_manage_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="levelcode != null">
        levelCode = #{levelcode,jdbcType=VARCHAR},
      </if>
      <if test="t2flow != null">
        t2Flow = #{t2flow,jdbcType=DECIMAL},
      </if>
      <if test="t3flow != null">
        t3Flow = #{t3flow,jdbcType=DECIMAL},
      </if>
      <if test="t2profit != null">
        t2Profit = #{t2profit,jdbcType=DECIMAL},
      </if>
      <if test="t3profit != null">
        t3Profit = #{t3profit,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="profitdate != null">
        profitDate = #{profitdate,jdbcType=DATE},
      </if>
      <if test="profitmonth != null">
        profitMonth = #{profitmonth,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserManageProfit">
    update tb_pluss_user_manage_profit
    set userId = #{userid,jdbcType=INTEGER},
      parentId = #{parentid,jdbcType=INTEGER},
      roleCode = #{rolecode,jdbcType=VARCHAR},
      levelCode = #{levelcode,jdbcType=VARCHAR},
      t2Flow = #{t2flow,jdbcType=DECIMAL},
      t3Flow = #{t3flow,jdbcType=DECIMAL},
      t2Profit = #{t2profit,jdbcType=DECIMAL},
      t3Profit = #{t3profit,jdbcType=DECIMAL},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      profitDate = #{profitdate,jdbcType=DATE},
      profitMonth = #{profitmonth,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>