<?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.TbPlussMerchantOrderStatisticsMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMerchantOrderStatistics">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="totalFee" jdbcType="DECIMAL" property="totalfee" />
    <result column="count" jdbcType="INTEGER" property="count" />
    <result column="retFee" jdbcType="DECIMAL" property="retfee" />
    <result column="retCount" jdbcType="INTEGER" property="retcount" />
    <result column="startDate" jdbcType="DATE" property="startdate" />
    <result column="endDate" jdbcType="DATE" property="enddate" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, merchantCode, totalFee, count, retFee, retCount, startDate, endDate, createTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merchant_order_statistics
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merchant_order_statistics
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantOrderStatistics">
    insert into tb_pluss_merchant_order_statistics (id, merchantCode, totalFee, 
      count, retFee, retCount, 
      startDate, endDate, createTime
      )
    values (#{id,jdbcType=INTEGER}, #{merchantcode,jdbcType=VARCHAR}, #{totalfee,jdbcType=DECIMAL}, 
      #{count,jdbcType=INTEGER}, #{retfee,jdbcType=DECIMAL}, #{retcount,jdbcType=INTEGER}, 
      #{startdate,jdbcType=DATE}, #{enddate,jdbcType=DATE}, #{createtime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantOrderStatistics">
    insert into tb_pluss_merchant_order_statistics
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="totalfee != null">
        totalFee,
      </if>
      <if test="count != null">
        count,
      </if>
      <if test="retfee != null">
        retFee,
      </if>
      <if test="retcount != null">
        retCount,
      </if>
      <if test="startdate != null">
        startDate,
      </if>
      <if test="enddate != null">
        endDate,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="merchantcode != null">
        #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="totalfee != null">
        #{totalfee,jdbcType=DECIMAL},
      </if>
      <if test="count != null">
        #{count,jdbcType=INTEGER},
      </if>
      <if test="retfee != null">
        #{retfee,jdbcType=DECIMAL},
      </if>
      <if test="retcount != null">
        #{retcount,jdbcType=INTEGER},
      </if>
      <if test="startdate != null">
        #{startdate,jdbcType=DATE},
      </if>
      <if test="enddate != null">
        #{enddate,jdbcType=DATE},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantOrderStatistics">
    update tb_pluss_merchant_order_statistics
    <set>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="totalfee != null">
        totalFee = #{totalfee,jdbcType=DECIMAL},
      </if>
      <if test="count != null">
        count = #{count,jdbcType=INTEGER},
      </if>
      <if test="retfee != null">
        retFee = #{retfee,jdbcType=DECIMAL},
      </if>
      <if test="retcount != null">
        retCount = #{retcount,jdbcType=INTEGER},
      </if>
      <if test="startdate != null">
        startDate = #{startdate,jdbcType=DATE},
      </if>
      <if test="enddate != null">
        endDate = #{enddate,jdbcType=DATE},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantOrderStatistics">
    update tb_pluss_merchant_order_statistics
    set merchantCode = #{merchantcode,jdbcType=VARCHAR},
      totalFee = #{totalfee,jdbcType=DECIMAL},
      count = #{count,jdbcType=INTEGER},
      retFee = #{retfee,jdbcType=DECIMAL},
      retCount = #{retcount,jdbcType=INTEGER},
      startDate = #{startdate,jdbcType=DATE},
      endDate = #{enddate,jdbcType=DATE},
      createTime = #{createtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>