<?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.TbPlussActivityRechargeMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussActivityRecharge">
    <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="rechargeMoney" jdbcType="DOUBLE" property="rechargemoney" />
    <result column="giveMoney" jdbcType="DOUBLE" property="givemoney" />
    <result column="startDt" jdbcType="TIMESTAMP" property="startdt" />
    <result column="endDt" jdbcType="TIMESTAMP" property="enddt" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
    <result column="timeType" jdbcType="INTEGER" property="timetype" />
    <result column="storeId" jdbcType="VARCHAR" property="storeid" />
    <result column="storeName" jdbcType="VARCHAR" property="storename" />
    <result column="posterUrl" jdbcType="VARCHAR" property="posterurl" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, merchantCode, merchantName, rechargeMoney, giveMoney, startDt, endDt, 
    name, createDt, timeType, storeId, storeName, posterUrl
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_activity_recharge
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_activity_recharge
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussActivityRecharge">
    insert into tb_pluss_activity_recharge (id, userId, merchantCode, 
      merchantName, rechargeMoney, giveMoney, 
      startDt, endDt, name, 
      createDt, timeType, storeId, 
      storeName, posterUrl)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{merchantcode,jdbcType=VARCHAR}, 
      #{merchantname,jdbcType=VARCHAR}, #{rechargemoney,jdbcType=DOUBLE}, #{givemoney,jdbcType=DOUBLE}, 
      #{startdt,jdbcType=TIMESTAMP}, #{enddt,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, 
      #{createdt,jdbcType=TIMESTAMP}, #{timetype,jdbcType=INTEGER}, #{storeid,jdbcType=VARCHAR}, 
      #{storename,jdbcType=VARCHAR}, #{posterurl,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussActivityRecharge">
    insert into tb_pluss_activity_recharge
    <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="rechargemoney != null">
        rechargeMoney,
      </if>
      <if test="givemoney != null">
        giveMoney,
      </if>
      <if test="startdt != null">
        startDt,
      </if>
      <if test="enddt != null">
        endDt,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="createdt != null">
        createDt,
      </if>
      <if test="timetype != null">
        timeType,
      </if>
      <if test="storeid != null">
        storeId,
      </if>
      <if test="storename != null">
        storeName,
      </if>
      <if test="posterurl != null">
        posterUrl,
      </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="rechargemoney != null">
        #{rechargemoney,jdbcType=DOUBLE},
      </if>
      <if test="givemoney != null">
        #{givemoney,jdbcType=DOUBLE},
      </if>
      <if test="startdt != null">
        #{startdt,jdbcType=TIMESTAMP},
      </if>
      <if test="enddt != null">
        #{enddt,jdbcType=TIMESTAMP},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="createdt != null">
        #{createdt,jdbcType=TIMESTAMP},
      </if>
      <if test="timetype != null">
        #{timetype,jdbcType=INTEGER},
      </if>
      <if test="storeid != null">
        #{storeid,jdbcType=VARCHAR},
      </if>
      <if test="storename != null">
        #{storename,jdbcType=VARCHAR},
      </if>
      <if test="posterurl != null">
        #{posterurl,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussActivityRecharge">
    update tb_pluss_activity_recharge
    <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="rechargemoney != null">
        rechargeMoney = #{rechargemoney,jdbcType=DOUBLE},
      </if>
      <if test="givemoney != null">
        giveMoney = #{givemoney,jdbcType=DOUBLE},
      </if>
      <if test="startdt != null">
        startDt = #{startdt,jdbcType=TIMESTAMP},
      </if>
      <if test="enddt != null">
        endDt = #{enddt,jdbcType=TIMESTAMP},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="createdt != null">
        createDt = #{createdt,jdbcType=TIMESTAMP},
      </if>
      <if test="timetype != null">
        timeType = #{timetype,jdbcType=INTEGER},
      </if>
      <if test="storeid != null">
        storeId = #{storeid,jdbcType=VARCHAR},
      </if>
      <if test="storename != null">
        storeName = #{storename,jdbcType=VARCHAR},
      </if>
      <if test="posterurl != null">
        posterUrl = #{posterurl,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussActivityRecharge">
    update tb_pluss_activity_recharge
    set userId = #{userid,jdbcType=INTEGER},
      merchantCode = #{merchantcode,jdbcType=VARCHAR},
      merchantName = #{merchantname,jdbcType=VARCHAR},
      rechargeMoney = #{rechargemoney,jdbcType=DOUBLE},
      giveMoney = #{givemoney,jdbcType=DOUBLE},
      startDt = #{startdt,jdbcType=TIMESTAMP},
      endDt = #{enddt,jdbcType=TIMESTAMP},
      name = #{name,jdbcType=VARCHAR},
      createDt = #{createdt,jdbcType=TIMESTAMP},
      timeType = #{timetype,jdbcType=INTEGER},
      storeId = #{storeid,jdbcType=VARCHAR},
      storeName = #{storename,jdbcType=VARCHAR},
      posterUrl = #{posterurl,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>