<?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.TbPlussUserRewardFlowMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserRewardFlow">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="parentId" jdbcType="INTEGER" property="parentid" />
    <result column="t2Flow" jdbcType="DECIMAL" property="t2flow" />
    <result column="t3Flow" jdbcType="DECIMAL" property="t3flow" />
    <result column="dividFlow" jdbcType="DECIMAL" property="dividflow" />
    <result column="areaFlow" jdbcType="DECIMAL" property="areaflow" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="createDate" jdbcType="DATE" property="createdate" />
    <result column="orderNumber" jdbcType="VARCHAR" property="ordernumber" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="createMonth" jdbcType="VARCHAR" property="createmonth" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, parentId, t2Flow, t3Flow, dividFlow, areaFlow, createTime, createDate, 
    orderNumber, status, createMonth
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_reward_flow
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_reward_flow
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserRewardFlow">
    insert into tb_pluss_user_reward_flow (id, userId, parentId, 
      t2Flow, t3Flow, dividFlow, 
      areaFlow, createTime, createDate, 
      orderNumber, status, createMonth
      )
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{parentid,jdbcType=INTEGER}, 
      #{t2flow,jdbcType=DECIMAL}, #{t3flow,jdbcType=DECIMAL}, #{dividflow,jdbcType=DECIMAL}, 
      #{areaflow,jdbcType=DECIMAL}, #{createtime,jdbcType=TIMESTAMP}, #{createdate,jdbcType=DATE}, 
      #{ordernumber,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createmonth,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserRewardFlow">
    insert into tb_pluss_user_reward_flow
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="parentid != null">
        parentId,
      </if>
      <if test="t2flow != null">
        t2Flow,
      </if>
      <if test="t3flow != null">
        t3Flow,
      </if>
      <if test="dividflow != null">
        dividFlow,
      </if>
      <if test="areaflow != null">
        areaFlow,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="createdate != null">
        createDate,
      </if>
      <if test="ordernumber != null">
        orderNumber,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="createmonth != null">
        createMonth,
      </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="t2flow != null">
        #{t2flow,jdbcType=DECIMAL},
      </if>
      <if test="t3flow != null">
        #{t3flow,jdbcType=DECIMAL},
      </if>
      <if test="dividflow != null">
        #{dividflow,jdbcType=DECIMAL},
      </if>
      <if test="areaflow != null">
        #{areaflow,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdate != null">
        #{createdate,jdbcType=DATE},
      </if>
      <if test="ordernumber != null">
        #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="createmonth != null">
        #{createmonth,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserRewardFlow">
    update tb_pluss_user_reward_flow
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="parentid != null">
        parentId = #{parentid,jdbcType=INTEGER},
      </if>
      <if test="t2flow != null">
        t2Flow = #{t2flow,jdbcType=DECIMAL},
      </if>
      <if test="t3flow != null">
        t3Flow = #{t3flow,jdbcType=DECIMAL},
      </if>
      <if test="dividflow != null">
        dividFlow = #{dividflow,jdbcType=DECIMAL},
      </if>
      <if test="areaflow != null">
        areaFlow = #{areaflow,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdate != null">
        createDate = #{createdate,jdbcType=DATE},
      </if>
      <if test="ordernumber != null">
        orderNumber = #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="createmonth != null">
        createMonth = #{createmonth,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserRewardFlow">
    update tb_pluss_user_reward_flow
    set userId = #{userid,jdbcType=INTEGER},
      parentId = #{parentid,jdbcType=INTEGER},
      t2Flow = #{t2flow,jdbcType=DECIMAL},
      t3Flow = #{t3flow,jdbcType=DECIMAL},
      dividFlow = #{dividflow,jdbcType=DECIMAL},
      areaFlow = #{areaflow,jdbcType=DECIMAL},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      createDate = #{createdate,jdbcType=DATE},
      orderNumber = #{ordernumber,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      createMonth = #{createmonth,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>