<?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.TbPlussMerchantMenberMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMerchantMenber">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="merchantName" jdbcType="VARCHAR" property="merchantname" />
    <result column="storeId" jdbcType="VARCHAR" property="storeid" />
    <result column="storeName" jdbcType="VARCHAR" property="storename" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
    <result column="logo" jdbcType="VARCHAR" property="logo" />
    <result column="memberCode" jdbcType="VARCHAR" property="membercode" />
    <result column="memberName" jdbcType="VARCHAR" property="membername" />
    <result column="provinces" jdbcType="VARCHAR" property="provinces" />
    <result column="sex" jdbcType="VARCHAR" property="sex" />
    <result column="nickName" jdbcType="VARCHAR" property="nickname" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="openid" jdbcType="VARCHAR" property="openid" />
    <result column="alipayUserId" jdbcType="VARCHAR" property="alipayuserid" />
    <result column="comsumeMoney" jdbcType="DOUBLE" property="comsumemoney" />
    <result column="profitMoney" jdbcType="DOUBLE" property="profitmoney" />
    <result column="orderNumber" jdbcType="VARCHAR" property="ordernumber" />
    <result column="totalRechargeFee" jdbcType="DOUBLE" property="totalrechargefee" />
    <result column="usableRechargeFee" jdbcType="DOUBLE" property="usablerechargefee" />
    <result column="totalGiveFee" jdbcType="DOUBLE" property="totalgivefee" />
    <result column="usableGiveFee" jdbcType="DOUBLE" property="usablegivefee" />
    <result column="birthdayDt" jdbcType="VARCHAR" property="birthdaydt" />
    <result column="cardNo" jdbcType="VARCHAR" property="cardno" />
    <result column="bindingUrl" jdbcType="VARCHAR" property="bindingurl" />
    <result column="appOpenId" jdbcType="VARCHAR" property="appopenid" />
    <result column="unionId" jdbcType="VARCHAR" property="unionid" />
  </resultMap>
  <sql id="Base_Column_List">
    id, merchantCode, merchantName, storeId, storeName, status, createDt, logo, memberCode, 
    memberName, provinces, sex, nickName, phone, openid, alipayUserId, comsumeMoney, 
    profitMoney, orderNumber, totalRechargeFee, usableRechargeFee, totalGiveFee, usableGiveFee, 
    birthdayDt, cardNo, bindingUrl, appOpenId, unionId
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merchant_menber
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merchant_menber
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantMenber">
    insert into tb_pluss_merchant_menber (id, merchantCode, merchantName, 
      storeId, storeName, status, 
      createDt, logo, memberCode, 
      memberName, provinces, sex, 
      nickName, phone, openid, 
      alipayUserId, comsumeMoney, profitMoney, 
      orderNumber, totalRechargeFee, usableRechargeFee, 
      totalGiveFee, usableGiveFee, birthdayDt, 
      cardNo, bindingUrl, appOpenId, 
      unionId)
    values (#{id,jdbcType=INTEGER}, #{merchantcode,jdbcType=VARCHAR}, #{merchantname,jdbcType=VARCHAR}, 
      #{storeid,jdbcType=VARCHAR}, #{storename,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
      #{createdt,jdbcType=TIMESTAMP}, #{logo,jdbcType=VARCHAR}, #{membercode,jdbcType=VARCHAR}, 
      #{membername,jdbcType=VARCHAR}, #{provinces,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, 
      #{nickname,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{openid,jdbcType=VARCHAR}, 
      #{alipayuserid,jdbcType=VARCHAR}, #{comsumemoney,jdbcType=DOUBLE}, #{profitmoney,jdbcType=DOUBLE}, 
      #{ordernumber,jdbcType=VARCHAR}, #{totalrechargefee,jdbcType=DOUBLE}, #{usablerechargefee,jdbcType=DOUBLE}, 
      #{totalgivefee,jdbcType=DOUBLE}, #{usablegivefee,jdbcType=DOUBLE}, #{birthdaydt,jdbcType=VARCHAR}, 
      #{cardno,jdbcType=VARCHAR}, #{bindingurl,jdbcType=VARCHAR}, #{appopenid,jdbcType=VARCHAR}, 
      #{unionid,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantMenber">
    insert into tb_pluss_merchant_menber
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="merchantname != null">
        merchantName,
      </if>
      <if test="storeid != null">
        storeId,
      </if>
      <if test="storename != null">
        storeName,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="createdt != null">
        createDt,
      </if>
      <if test="logo != null">
        logo,
      </if>
      <if test="membercode != null">
        memberCode,
      </if>
      <if test="membername != null">
        memberName,
      </if>
      <if test="provinces != null">
        provinces,
      </if>
      <if test="sex != null">
        sex,
      </if>
      <if test="nickname != null">
        nickName,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="openid != null">
        openid,
      </if>
      <if test="alipayuserid != null">
        alipayUserId,
      </if>
      <if test="comsumemoney != null">
        comsumeMoney,
      </if>
      <if test="profitmoney != null">
        profitMoney,
      </if>
      <if test="ordernumber != null">
        orderNumber,
      </if>
      <if test="totalrechargefee != null">
        totalRechargeFee,
      </if>
      <if test="usablerechargefee != null">
        usableRechargeFee,
      </if>
      <if test="totalgivefee != null">
        totalGiveFee,
      </if>
      <if test="usablegivefee != null">
        usableGiveFee,
      </if>
      <if test="birthdaydt != null">
        birthdayDt,
      </if>
      <if test="cardno != null">
        cardNo,
      </if>
      <if test="bindingurl != null">
        bindingUrl,
      </if>
      <if test="appopenid != null">
        appOpenId,
      </if>
      <if test="unionid != null">
        unionId,
      </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="merchantname != null">
        #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="storeid != null">
        #{storeid,jdbcType=VARCHAR},
      </if>
      <if test="storename != null">
        #{storename,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="createdt != null">
        #{createdt,jdbcType=TIMESTAMP},
      </if>
      <if test="logo != null">
        #{logo,jdbcType=VARCHAR},
      </if>
      <if test="membercode != null">
        #{membercode,jdbcType=VARCHAR},
      </if>
      <if test="membername != null">
        #{membername,jdbcType=VARCHAR},
      </if>
      <if test="provinces != null">
        #{provinces,jdbcType=VARCHAR},
      </if>
      <if test="sex != null">
        #{sex,jdbcType=VARCHAR},
      </if>
      <if test="nickname != null">
        #{nickname,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="openid != null">
        #{openid,jdbcType=VARCHAR},
      </if>
      <if test="alipayuserid != null">
        #{alipayuserid,jdbcType=VARCHAR},
      </if>
      <if test="comsumemoney != null">
        #{comsumemoney,jdbcType=DOUBLE},
      </if>
      <if test="profitmoney != null">
        #{profitmoney,jdbcType=DOUBLE},
      </if>
      <if test="ordernumber != null">
        #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="totalrechargefee != null">
        #{totalrechargefee,jdbcType=DOUBLE},
      </if>
      <if test="usablerechargefee != null">
        #{usablerechargefee,jdbcType=DOUBLE},
      </if>
      <if test="totalgivefee != null">
        #{totalgivefee,jdbcType=DOUBLE},
      </if>
      <if test="usablegivefee != null">
        #{usablegivefee,jdbcType=DOUBLE},
      </if>
      <if test="birthdaydt != null">
        #{birthdaydt,jdbcType=VARCHAR},
      </if>
      <if test="cardno != null">
        #{cardno,jdbcType=VARCHAR},
      </if>
      <if test="bindingurl != null">
        #{bindingurl,jdbcType=VARCHAR},
      </if>
      <if test="appopenid != null">
        #{appopenid,jdbcType=VARCHAR},
      </if>
      <if test="unionid != null">
        #{unionid,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantMenber">
    update tb_pluss_merchant_menber
    <set>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        merchantName = #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="storeid != null">
        storeId = #{storeid,jdbcType=VARCHAR},
      </if>
      <if test="storename != null">
        storeName = #{storename,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="createdt != null">
        createDt = #{createdt,jdbcType=TIMESTAMP},
      </if>
      <if test="logo != null">
        logo = #{logo,jdbcType=VARCHAR},
      </if>
      <if test="membercode != null">
        memberCode = #{membercode,jdbcType=VARCHAR},
      </if>
      <if test="membername != null">
        memberName = #{membername,jdbcType=VARCHAR},
      </if>
      <if test="provinces != null">
        provinces = #{provinces,jdbcType=VARCHAR},
      </if>
      <if test="sex != null">
        sex = #{sex,jdbcType=VARCHAR},
      </if>
      <if test="nickname != null">
        nickName = #{nickname,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="openid != null">
        openid = #{openid,jdbcType=VARCHAR},
      </if>
      <if test="alipayuserid != null">
        alipayUserId = #{alipayuserid,jdbcType=VARCHAR},
      </if>
      <if test="comsumemoney != null">
        comsumeMoney = #{comsumemoney,jdbcType=DOUBLE},
      </if>
      <if test="profitmoney != null">
        profitMoney = #{profitmoney,jdbcType=DOUBLE},
      </if>
      <if test="ordernumber != null">
        orderNumber = #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="totalrechargefee != null">
        totalRechargeFee = #{totalrechargefee,jdbcType=DOUBLE},
      </if>
      <if test="usablerechargefee != null">
        usableRechargeFee = #{usablerechargefee,jdbcType=DOUBLE},
      </if>
      <if test="totalgivefee != null">
        totalGiveFee = #{totalgivefee,jdbcType=DOUBLE},
      </if>
      <if test="usablegivefee != null">
        usableGiveFee = #{usablegivefee,jdbcType=DOUBLE},
      </if>
      <if test="birthdaydt != null">
        birthdayDt = #{birthdaydt,jdbcType=VARCHAR},
      </if>
      <if test="cardno != null">
        cardNo = #{cardno,jdbcType=VARCHAR},
      </if>
      <if test="bindingurl != null">
        bindingUrl = #{bindingurl,jdbcType=VARCHAR},
      </if>
      <if test="appopenid != null">
        appOpenId = #{appopenid,jdbcType=VARCHAR},
      </if>
      <if test="unionid != null">
        unionId = #{unionid,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantMenber">
    update tb_pluss_merchant_menber
    set merchantCode = #{merchantcode,jdbcType=VARCHAR},
      merchantName = #{merchantname,jdbcType=VARCHAR},
      storeId = #{storeid,jdbcType=VARCHAR},
      storeName = #{storename,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      createDt = #{createdt,jdbcType=TIMESTAMP},
      logo = #{logo,jdbcType=VARCHAR},
      memberCode = #{membercode,jdbcType=VARCHAR},
      memberName = #{membername,jdbcType=VARCHAR},
      provinces = #{provinces,jdbcType=VARCHAR},
      sex = #{sex,jdbcType=VARCHAR},
      nickName = #{nickname,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      openid = #{openid,jdbcType=VARCHAR},
      alipayUserId = #{alipayuserid,jdbcType=VARCHAR},
      comsumeMoney = #{comsumemoney,jdbcType=DOUBLE},
      profitMoney = #{profitmoney,jdbcType=DOUBLE},
      orderNumber = #{ordernumber,jdbcType=VARCHAR},
      totalRechargeFee = #{totalrechargefee,jdbcType=DOUBLE},
      usableRechargeFee = #{usablerechargefee,jdbcType=DOUBLE},
      totalGiveFee = #{totalgivefee,jdbcType=DOUBLE},
      usableGiveFee = #{usablegivefee,jdbcType=DOUBLE},
      birthdayDt = #{birthdaydt,jdbcType=VARCHAR},
      cardNo = #{cardno,jdbcType=VARCHAR},
      bindingUrl = #{bindingurl,jdbcType=VARCHAR},
      appOpenId = #{appopenid,jdbcType=VARCHAR},
      unionId = #{unionid,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>