<?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.TbPlussMemberTransStatisticsMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMemberTransStatistics">
    <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="type" jdbcType="VARCHAR" property="type" />
    <result column="rechargeAmount" jdbcType="DECIMAL" property="rechargeamount" />
    <result column="consumeAmount" jdbcType="DECIMAL" property="consumeamount" />
    <result column="giveAmount" jdbcType="DECIMAL" property="giveamount" />
    <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, type, rechargeAmount, consumeAmount, giveAmount, 
    remark, createTime, updateTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_member_trans_statistics
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_member_trans_statistics
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMemberTransStatistics">
    insert into tb_pluss_member_trans_statistics (id, userId, startDate, 
      endDate, type, rechargeAmount, 
      consumeAmount, giveAmount, remark, 
      createTime, updateTime)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{startdate,jdbcType=DATE}, 
      #{enddate,jdbcType=DATE}, #{type,jdbcType=VARCHAR}, #{rechargeamount,jdbcType=DECIMAL}, 
      #{consumeamount,jdbcType=DECIMAL}, #{giveamount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMemberTransStatistics">
    insert into tb_pluss_member_trans_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="type != null">
        type,
      </if>
      <if test="rechargeamount != null">
        rechargeAmount,
      </if>
      <if test="consumeamount != null">
        consumeAmount,
      </if>
      <if test="giveamount != null">
        giveAmount,
      </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="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="rechargeamount != null">
        #{rechargeamount,jdbcType=DECIMAL},
      </if>
      <if test="consumeamount != null">
        #{consumeamount,jdbcType=DECIMAL},
      </if>
      <if test="giveamount != null">
        #{giveamount,jdbcType=DECIMAL},
      </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.TbPlussMemberTransStatistics">
    update tb_pluss_member_trans_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="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="rechargeamount != null">
        rechargeAmount = #{rechargeamount,jdbcType=DECIMAL},
      </if>
      <if test="consumeamount != null">
        consumeAmount = #{consumeamount,jdbcType=DECIMAL},
      </if>
      <if test="giveamount != null">
        giveAmount = #{giveamount,jdbcType=DECIMAL},
      </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.TbPlussMemberTransStatistics">
    update tb_pluss_member_trans_statistics
    set userId = #{userid,jdbcType=INTEGER},
      startDate = #{startdate,jdbcType=DATE},
      endDate = #{enddate,jdbcType=DATE},
      type = #{type,jdbcType=VARCHAR},
      rechargeAmount = #{rechargeamount,jdbcType=DECIMAL},
      consumeAmount = #{consumeamount,jdbcType=DECIMAL},
      giveAmount = #{giveamount,jdbcType=DECIMAL},
      remark = #{remark,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>