<?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.TbPlussMerchantProfitMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMerchantProfit">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="price" jdbcType="DECIMAL" property="price" />
    <result column="orderNumber" jdbcType="VARCHAR" property="ordernumber" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="merchantName" jdbcType="VARCHAR" property="merchantname" />
    <result column="consumeFee" jdbcType="DOUBLE" property="consumefee" />
    <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
    <result column="orderDt" jdbcType="TIMESTAMP" property="orderdt" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="payTypeCode" jdbcType="VARCHAR" property="paytypecode" />
    <result column="payTypeName" jdbcType="VARCHAR" property="paytypename" />
    <result column="merchantLogo" jdbcType="VARCHAR" property="merchantlogo" />
    <result column="level" jdbcType="INTEGER" property="level" />
    <result column="merchantParentId" jdbcType="INTEGER" property="merchantparentid" />
    <result column="merchantParentName" jdbcType="VARCHAR" property="merchantparentname" />
    <result column="merchantParentLogo" jdbcType="VARCHAR" property="merchantparentlogo" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="userName" jdbcType="VARCHAR" property="username" />
    <result column="merchantParentLevel" jdbcType="VARCHAR" property="merchantparentlevel" />
    <result column="merchantParentPhone" jdbcType="VARCHAR" property="merchantparentphone" />
    <result column="profitRate" jdbcType="INTEGER" property="profitrate" />
    <result column="agentStaffId" jdbcType="INTEGER" property="agentstaffid" />
    <result column="recordDate" jdbcType="DATE" property="recorddate" />
    <result column="recordMonth" jdbcType="VARCHAR" property="recordmonth" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, type, price, orderNumber, merchantCode, merchantName, consumeFee, createDt, 
    orderDt, status, payTypeCode, payTypeName, merchantLogo, level, merchantParentId, 
    merchantParentName, merchantParentLogo, phone, userName, merchantParentLevel, merchantParentPhone, 
    profitRate, agentStaffId, recordDate, recordMonth
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merchant_profit
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merchant_profit
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantProfit">
    insert into tb_pluss_merchant_profit (id, userId, type, 
      price, orderNumber, merchantCode, 
      merchantName, consumeFee, createDt, 
      orderDt, status, payTypeCode, 
      payTypeName, merchantLogo, level, 
      merchantParentId, merchantParentName, merchantParentLogo, 
      phone, userName, merchantParentLevel, 
      merchantParentPhone, profitRate, agentStaffId, 
      recordDate, recordMonth)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, 
      #{price,jdbcType=DECIMAL}, #{ordernumber,jdbcType=VARCHAR}, #{merchantcode,jdbcType=VARCHAR}, 
      #{merchantname,jdbcType=VARCHAR}, #{consumefee,jdbcType=DOUBLE}, #{createdt,jdbcType=TIMESTAMP}, 
      #{orderdt,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{paytypecode,jdbcType=VARCHAR}, 
      #{paytypename,jdbcType=VARCHAR}, #{merchantlogo,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, 
      #{merchantparentid,jdbcType=INTEGER}, #{merchantparentname,jdbcType=VARCHAR}, #{merchantparentlogo,jdbcType=VARCHAR}, 
      #{phone,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{merchantparentlevel,jdbcType=VARCHAR}, 
      #{merchantparentphone,jdbcType=VARCHAR}, #{profitrate,jdbcType=INTEGER}, #{agentstaffid,jdbcType=INTEGER}, 
      #{recorddate,jdbcType=DATE}, #{recordmonth,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantProfit">
    insert into tb_pluss_merchant_profit
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="ordernumber != null">
        orderNumber,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="merchantname != null">
        merchantName,
      </if>
      <if test="consumefee != null">
        consumeFee,
      </if>
      <if test="createdt != null">
        createDt,
      </if>
      <if test="orderdt != null">
        orderDt,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="paytypecode != null">
        payTypeCode,
      </if>
      <if test="paytypename != null">
        payTypeName,
      </if>
      <if test="merchantlogo != null">
        merchantLogo,
      </if>
      <if test="level != null">
        level,
      </if>
      <if test="merchantparentid != null">
        merchantParentId,
      </if>
      <if test="merchantparentname != null">
        merchantParentName,
      </if>
      <if test="merchantparentlogo != null">
        merchantParentLogo,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="username != null">
        userName,
      </if>
      <if test="merchantparentlevel != null">
        merchantParentLevel,
      </if>
      <if test="merchantparentphone != null">
        merchantParentPhone,
      </if>
      <if test="profitrate != null">
        profitRate,
      </if>
      <if test="agentstaffid != null">
        agentStaffId,
      </if>
      <if test="recorddate != null">
        recordDate,
      </if>
      <if test="recordmonth != null">
        recordMonth,
      </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="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="price != null">
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="ordernumber != null">
        #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="consumefee != null">
        #{consumefee,jdbcType=DOUBLE},
      </if>
      <if test="createdt != null">
        #{createdt,jdbcType=TIMESTAMP},
      </if>
      <if test="orderdt != null">
        #{orderdt,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="paytypecode != null">
        #{paytypecode,jdbcType=VARCHAR},
      </if>
      <if test="paytypename != null">
        #{paytypename,jdbcType=VARCHAR},
      </if>
      <if test="merchantlogo != null">
        #{merchantlogo,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        #{level,jdbcType=INTEGER},
      </if>
      <if test="merchantparentid != null">
        #{merchantparentid,jdbcType=INTEGER},
      </if>
      <if test="merchantparentname != null">
        #{merchantparentname,jdbcType=VARCHAR},
      </if>
      <if test="merchantparentlogo != null">
        #{merchantparentlogo,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="username != null">
        #{username,jdbcType=VARCHAR},
      </if>
      <if test="merchantparentlevel != null">
        #{merchantparentlevel,jdbcType=VARCHAR},
      </if>
      <if test="merchantparentphone != null">
        #{merchantparentphone,jdbcType=VARCHAR},
      </if>
      <if test="profitrate != null">
        #{profitrate,jdbcType=INTEGER},
      </if>
      <if test="agentstaffid != null">
        #{agentstaffid,jdbcType=INTEGER},
      </if>
      <if test="recorddate != null">
        #{recorddate,jdbcType=DATE},
      </if>
      <if test="recordmonth != null">
        #{recordmonth,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantProfit">
    update tb_pluss_merchant_profit
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="ordernumber != null">
        orderNumber = #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        merchantName = #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="consumefee != null">
        consumeFee = #{consumefee,jdbcType=DOUBLE},
      </if>
      <if test="createdt != null">
        createDt = #{createdt,jdbcType=TIMESTAMP},
      </if>
      <if test="orderdt != null">
        orderDt = #{orderdt,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="paytypecode != null">
        payTypeCode = #{paytypecode,jdbcType=VARCHAR},
      </if>
      <if test="paytypename != null">
        payTypeName = #{paytypename,jdbcType=VARCHAR},
      </if>
      <if test="merchantlogo != null">
        merchantLogo = #{merchantlogo,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        level = #{level,jdbcType=INTEGER},
      </if>
      <if test="merchantparentid != null">
        merchantParentId = #{merchantparentid,jdbcType=INTEGER},
      </if>
      <if test="merchantparentname != null">
        merchantParentName = #{merchantparentname,jdbcType=VARCHAR},
      </if>
      <if test="merchantparentlogo != null">
        merchantParentLogo = #{merchantparentlogo,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="username != null">
        userName = #{username,jdbcType=VARCHAR},
      </if>
      <if test="merchantparentlevel != null">
        merchantParentLevel = #{merchantparentlevel,jdbcType=VARCHAR},
      </if>
      <if test="merchantparentphone != null">
        merchantParentPhone = #{merchantparentphone,jdbcType=VARCHAR},
      </if>
      <if test="profitrate != null">
        profitRate = #{profitrate,jdbcType=INTEGER},
      </if>
      <if test="agentstaffid != null">
        agentStaffId = #{agentstaffid,jdbcType=INTEGER},
      </if>
      <if test="recorddate != null">
        recordDate = #{recorddate,jdbcType=DATE},
      </if>
      <if test="recordmonth != null">
        recordMonth = #{recordmonth,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantProfit">
    update tb_pluss_merchant_profit
    set userId = #{userid,jdbcType=INTEGER},
      type = #{type,jdbcType=VARCHAR},
      price = #{price,jdbcType=DECIMAL},
      orderNumber = #{ordernumber,jdbcType=VARCHAR},
      merchantCode = #{merchantcode,jdbcType=VARCHAR},
      merchantName = #{merchantname,jdbcType=VARCHAR},
      consumeFee = #{consumefee,jdbcType=DOUBLE},
      createDt = #{createdt,jdbcType=TIMESTAMP},
      orderDt = #{orderdt,jdbcType=TIMESTAMP},
      status = #{status,jdbcType=VARCHAR},
      payTypeCode = #{paytypecode,jdbcType=VARCHAR},
      payTypeName = #{paytypename,jdbcType=VARCHAR},
      merchantLogo = #{merchantlogo,jdbcType=VARCHAR},
      level = #{level,jdbcType=INTEGER},
      merchantParentId = #{merchantparentid,jdbcType=INTEGER},
      merchantParentName = #{merchantparentname,jdbcType=VARCHAR},
      merchantParentLogo = #{merchantparentlogo,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      userName = #{username,jdbcType=VARCHAR},
      merchantParentLevel = #{merchantparentlevel,jdbcType=VARCHAR},
      merchantParentPhone = #{merchantparentphone,jdbcType=VARCHAR},
      profitRate = #{profitrate,jdbcType=INTEGER},
      agentStaffId = #{agentstaffid,jdbcType=INTEGER},
      recordDate = #{recorddate,jdbcType=DATE},
      recordMonth = #{recordmonth,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>