<?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.TbPlussMerchantBillStatisticsMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMerchantBillStatistics">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="startDate" jdbcType="DATE" property="startdate" />
    <result column="endDate" jdbcType="DATE" property="enddate" />
    <result column="lastStartDate" jdbcType="DATE" property="laststartdate" />
    <result column="lastEndDate" jdbcType="DATE" property="lastenddate" />
    <result column="type" jdbcType="TINYINT" property="type" />
    <result column="amount" jdbcType="DECIMAL" property="amount" />
    <result column="count" jdbcType="INTEGER" property="count" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, startDate, endDate, lastStartDate, lastEndDate, type, amount, count, 
    remark, createTime, updateTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merchant_bill_statistics
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merchant_bill_statistics
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantBillStatistics">
    insert into tb_pluss_merchant_bill_statistics (id, userId, startDate, 
      endDate, lastStartDate, lastEndDate, 
      type, amount, count, 
      remark, createTime, updateTime
      )
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{startdate,jdbcType=DATE}, 
      #{enddate,jdbcType=DATE}, #{laststartdate,jdbcType=DATE}, #{lastenddate,jdbcType=DATE}, 
      #{type,jdbcType=TINYINT}, #{amount,jdbcType=DECIMAL}, #{count,jdbcType=INTEGER}, 
      #{remark,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantBillStatistics">
    insert into tb_pluss_merchant_bill_statistics
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="startdate != null">
        startDate,
      </if>
      <if test="enddate != null">
        endDate,
      </if>
      <if test="laststartdate != null">
        lastStartDate,
      </if>
      <if test="lastenddate != null">
        lastEndDate,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="count != null">
        count,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="updatetime != null">
        updateTime,
      </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="startdate != null">
        #{startdate,jdbcType=DATE},
      </if>
      <if test="enddate != null">
        #{enddate,jdbcType=DATE},
      </if>
      <if test="laststartdate != null">
        #{laststartdate,jdbcType=DATE},
      </if>
      <if test="lastenddate != null">
        #{lastenddate,jdbcType=DATE},
      </if>
      <if test="type != null">
        #{type,jdbcType=TINYINT},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DECIMAL},
      </if>
      <if test="count != null">
        #{count,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantBillStatistics">
    update tb_pluss_merchant_bill_statistics
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="startdate != null">
        startDate = #{startdate,jdbcType=DATE},
      </if>
      <if test="enddate != null">
        endDate = #{enddate,jdbcType=DATE},
      </if>
      <if test="laststartdate != null">
        lastStartDate = #{laststartdate,jdbcType=DATE},
      </if>
      <if test="lastenddate != null">
        lastEndDate = #{lastenddate,jdbcType=DATE},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=TINYINT},
      </if>
      <if test="amount != null">
        amount = #{amount,jdbcType=DECIMAL},
      </if>
      <if test="count != null">
        count = #{count,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantBillStatistics">
    update tb_pluss_merchant_bill_statistics
    set userId = #{userid,jdbcType=INTEGER},
      startDate = #{startdate,jdbcType=DATE},
      endDate = #{enddate,jdbcType=DATE},
      lastStartDate = #{laststartdate,jdbcType=DATE},
      lastEndDate = #{lastenddate,jdbcType=DATE},
      type = #{type,jdbcType=TINYINT},
      amount = #{amount,jdbcType=DECIMAL},
      count = #{count,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>