<?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.TbPlussMerchantMemberCodeMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMerchantMemberCode">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="cardNo" jdbcType="VARCHAR" property="cardno" />
    <result column="startTime" jdbcType="TIMESTAMP" property="starttime" />
    <result column="endTime" jdbcType="TIMESTAMP" property="endtime" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, code, merchantCode, cardNo, startTime, endTime, createTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merchant_member_code
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merchant_member_code
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantMemberCode">
    insert into tb_pluss_merchant_member_code (id, code, merchantCode, 
      cardNo, startTime, endTime, 
      createTime)
    values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{merchantcode,jdbcType=VARCHAR}, 
      #{cardno,jdbcType=VARCHAR}, #{starttime,jdbcType=TIMESTAMP}, #{endtime,jdbcType=TIMESTAMP}, 
      #{createtime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantMemberCode">
    insert into tb_pluss_merchant_member_code
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="cardno != null">
        cardNo,
      </if>
      <if test="starttime != null">
        startTime,
      </if>
      <if test="endtime != null">
        endTime,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="cardno != null">
        #{cardno,jdbcType=VARCHAR},
      </if>
      <if test="starttime != null">
        #{starttime,jdbcType=TIMESTAMP},
      </if>
      <if test="endtime != null">
        #{endtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantMemberCode">
    update tb_pluss_merchant_member_code
    <set>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="cardno != null">
        cardNo = #{cardno,jdbcType=VARCHAR},
      </if>
      <if test="starttime != null">
        startTime = #{starttime,jdbcType=TIMESTAMP},
      </if>
      <if test="endtime != null">
        endTime = #{endtime,jdbcType=TIMESTAMP},
      </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.TbPlussMerchantMemberCode">
    update tb_pluss_merchant_member_code
    set code = #{code,jdbcType=VARCHAR},
      merchantCode = #{merchantcode,jdbcType=VARCHAR},
      cardNo = #{cardno,jdbcType=VARCHAR},
      startTime = #{starttime,jdbcType=TIMESTAMP},
      endTime = #{endtime,jdbcType=TIMESTAMP},
      createTime = #{createtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>