<?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.TbPlussMerchantIncomeMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMerchantIncome">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="merchantName" jdbcType="VARCHAR" property="merchantname" />
    <result column="storeId" jdbcType="VARCHAR" property="storeid" />
    <result column="storeName" jdbcType="VARCHAR" property="storename" />
    <result column="dealType" jdbcType="INTEGER" property="dealtype" />
    <result column="dealFee" jdbcType="DOUBLE" property="dealfee" />
    <result column="incomeFee" jdbcType="DOUBLE" property="incomefee" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="payTypeCode" jdbcType="VARCHAR" property="paytypecode" />
    <result column="payTypeName" jdbcType="VARCHAR" property="paytypename" />
    <result column="memberCode" jdbcType="VARCHAR" property="membercode" />
    <result column="memberName" jdbcType="VARCHAR" property="membername" />
    <result column="memberPic" jdbcType="VARCHAR" property="memberpic" />
    <result column="incomeType" jdbcType="VARCHAR" property="incometype" />
    <result column="plateformProfit" jdbcType="DOUBLE" property="plateformprofit" />
    <result column="promoterProfit" jdbcType="DOUBLE" property="promoterprofit" />
    <result column="dealStatus" jdbcType="INTEGER" property="dealstatus" />
    <result column="dealCode" jdbcType="VARCHAR" property="dealcode" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, merchantCode, merchantName, storeId, storeName, dealType, dealFee, incomeFee, 
    createTime, payTypeCode, payTypeName, memberCode, memberName, memberPic, incomeType, 
    plateformProfit, promoterProfit, dealStatus, dealCode
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merchant_income
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merchant_income
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantIncome">
    insert into tb_pluss_merchant_income (id, userId, merchantCode, 
      merchantName, storeId, storeName, 
      dealType, dealFee, incomeFee, 
      createTime, payTypeCode, payTypeName, 
      memberCode, memberName, memberPic, 
      incomeType, plateformProfit, promoterProfit, 
      dealStatus, dealCode)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{merchantcode,jdbcType=VARCHAR}, 
      #{merchantname,jdbcType=VARCHAR}, #{storeid,jdbcType=VARCHAR}, #{storename,jdbcType=VARCHAR}, 
      #{dealtype,jdbcType=INTEGER}, #{dealfee,jdbcType=DOUBLE}, #{incomefee,jdbcType=DOUBLE}, 
      #{createtime,jdbcType=TIMESTAMP}, #{paytypecode,jdbcType=VARCHAR}, #{paytypename,jdbcType=VARCHAR}, 
      #{membercode,jdbcType=VARCHAR}, #{membername,jdbcType=VARCHAR}, #{memberpic,jdbcType=VARCHAR}, 
      #{incometype,jdbcType=VARCHAR}, #{plateformprofit,jdbcType=DOUBLE}, #{promoterprofit,jdbcType=DOUBLE}, 
      #{dealstatus,jdbcType=INTEGER}, #{dealcode,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantIncome">
    insert into tb_pluss_merchant_income
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="merchantname != null">
        merchantName,
      </if>
      <if test="storeid != null">
        storeId,
      </if>
      <if test="storename != null">
        storeName,
      </if>
      <if test="dealtype != null">
        dealType,
      </if>
      <if test="dealfee != null">
        dealFee,
      </if>
      <if test="incomefee != null">
        incomeFee,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="paytypecode != null">
        payTypeCode,
      </if>
      <if test="paytypename != null">
        payTypeName,
      </if>
      <if test="membercode != null">
        memberCode,
      </if>
      <if test="membername != null">
        memberName,
      </if>
      <if test="memberpic != null">
        memberPic,
      </if>
      <if test="incometype != null">
        incomeType,
      </if>
      <if test="plateformprofit != null">
        plateformProfit,
      </if>
      <if test="promoterprofit != null">
        promoterProfit,
      </if>
      <if test="dealstatus != null">
        dealStatus,
      </if>
      <if test="dealcode != null">
        dealCode,
      </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="merchantcode != null">
        #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="storeid != null">
        #{storeid,jdbcType=VARCHAR},
      </if>
      <if test="storename != null">
        #{storename,jdbcType=VARCHAR},
      </if>
      <if test="dealtype != null">
        #{dealtype,jdbcType=INTEGER},
      </if>
      <if test="dealfee != null">
        #{dealfee,jdbcType=DOUBLE},
      </if>
      <if test="incomefee != null">
        #{incomefee,jdbcType=DOUBLE},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="paytypecode != null">
        #{paytypecode,jdbcType=VARCHAR},
      </if>
      <if test="paytypename != null">
        #{paytypename,jdbcType=VARCHAR},
      </if>
      <if test="membercode != null">
        #{membercode,jdbcType=VARCHAR},
      </if>
      <if test="membername != null">
        #{membername,jdbcType=VARCHAR},
      </if>
      <if test="memberpic != null">
        #{memberpic,jdbcType=VARCHAR},
      </if>
      <if test="incometype != null">
        #{incometype,jdbcType=VARCHAR},
      </if>
      <if test="plateformprofit != null">
        #{plateformprofit,jdbcType=DOUBLE},
      </if>
      <if test="promoterprofit != null">
        #{promoterprofit,jdbcType=DOUBLE},
      </if>
      <if test="dealstatus != null">
        #{dealstatus,jdbcType=INTEGER},
      </if>
      <if test="dealcode != null">
        #{dealcode,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantIncome">
    update tb_pluss_merchant_income
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        merchantName = #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="storeid != null">
        storeId = #{storeid,jdbcType=VARCHAR},
      </if>
      <if test="storename != null">
        storeName = #{storename,jdbcType=VARCHAR},
      </if>
      <if test="dealtype != null">
        dealType = #{dealtype,jdbcType=INTEGER},
      </if>
      <if test="dealfee != null">
        dealFee = #{dealfee,jdbcType=DOUBLE},
      </if>
      <if test="incomefee != null">
        incomeFee = #{incomefee,jdbcType=DOUBLE},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="paytypecode != null">
        payTypeCode = #{paytypecode,jdbcType=VARCHAR},
      </if>
      <if test="paytypename != null">
        payTypeName = #{paytypename,jdbcType=VARCHAR},
      </if>
      <if test="membercode != null">
        memberCode = #{membercode,jdbcType=VARCHAR},
      </if>
      <if test="membername != null">
        memberName = #{membername,jdbcType=VARCHAR},
      </if>
      <if test="memberpic != null">
        memberPic = #{memberpic,jdbcType=VARCHAR},
      </if>
      <if test="incometype != null">
        incomeType = #{incometype,jdbcType=VARCHAR},
      </if>
      <if test="plateformprofit != null">
        plateformProfit = #{plateformprofit,jdbcType=DOUBLE},
      </if>
      <if test="promoterprofit != null">
        promoterProfit = #{promoterprofit,jdbcType=DOUBLE},
      </if>
      <if test="dealstatus != null">
        dealStatus = #{dealstatus,jdbcType=INTEGER},
      </if>
      <if test="dealcode != null">
        dealCode = #{dealcode,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantIncome">
    update tb_pluss_merchant_income
    set userId = #{userid,jdbcType=INTEGER},
      merchantCode = #{merchantcode,jdbcType=VARCHAR},
      merchantName = #{merchantname,jdbcType=VARCHAR},
      storeId = #{storeid,jdbcType=VARCHAR},
      storeName = #{storename,jdbcType=VARCHAR},
      dealType = #{dealtype,jdbcType=INTEGER},
      dealFee = #{dealfee,jdbcType=DOUBLE},
      incomeFee = #{incomefee,jdbcType=DOUBLE},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      payTypeCode = #{paytypecode,jdbcType=VARCHAR},
      payTypeName = #{paytypename,jdbcType=VARCHAR},
      memberCode = #{membercode,jdbcType=VARCHAR},
      memberName = #{membername,jdbcType=VARCHAR},
      memberPic = #{memberpic,jdbcType=VARCHAR},
      incomeType = #{incometype,jdbcType=VARCHAR},
      plateformProfit = #{plateformprofit,jdbcType=DOUBLE},
      promoterProfit = #{promoterprofit,jdbcType=DOUBLE},
      dealStatus = #{dealstatus,jdbcType=INTEGER},
      dealCode = #{dealcode,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>