<?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.TbPlussMercOrderTokenMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMercOrderToken">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="token" jdbcType="VARCHAR" property="token" />
    <result column="merchantName" jdbcType="VARCHAR" property="merchantname" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="orderAmt" jdbcType="DECIMAL" property="orderamt" />
    <result column="orderNumber" jdbcType="VARCHAR" property="ordernumber" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="snNo" jdbcType="VARCHAR" property="snno" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="expireTime" jdbcType="TIMESTAMP" property="expiretime" />
    <result column="mercOrderNo" jdbcType="VARCHAR" property="mercorderno" />
    <result column="mercNotifyUrl" jdbcType="VARCHAR" property="mercnotifyurl" />
    <result column="mercRefundUrl" jdbcType="VARCHAR" property="mercrefundurl" />
    <result column="subject" jdbcType="VARCHAR" property="subject" />
    <result column="channel" jdbcType="INTEGER" property="channel" />
    <result column="payTypeCode" jdbcType="VARCHAR" property="paytypecode" />
    <result column="payTypeName" jdbcType="VARCHAR" property="paytypename" />
    <result column="alias" jdbcType="VARCHAR" property="alias" />
  </resultMap>
  <sql id="Base_Column_List">
    id, token, merchantName, merchantCode, userId, orderAmt, orderNumber, type, snNo, 
    createTime, expireTime, mercOrderNo, mercNotifyUrl, mercRefundUrl, subject, channel, 
    payTypeCode, payTypeName, alias
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merc_order_token
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merc_order_token
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMercOrderToken">
    insert into tb_pluss_merc_order_token (id, token, merchantName, 
      merchantCode, userId, orderAmt, 
      orderNumber, type, snNo, 
      createTime, expireTime, mercOrderNo, 
      mercNotifyUrl, mercRefundUrl, subject, 
      channel, payTypeCode, payTypeName, 
      alias)
    values (#{id,jdbcType=INTEGER}, #{token,jdbcType=VARCHAR}, #{merchantname,jdbcType=VARCHAR}, 
      #{merchantcode,jdbcType=VARCHAR}, #{userid,jdbcType=INTEGER}, #{orderamt,jdbcType=DECIMAL}, 
      #{ordernumber,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{snno,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{expiretime,jdbcType=TIMESTAMP}, #{mercorderno,jdbcType=VARCHAR}, 
      #{mercnotifyurl,jdbcType=VARCHAR}, #{mercrefundurl,jdbcType=VARCHAR}, #{subject,jdbcType=VARCHAR}, 
      #{channel,jdbcType=INTEGER}, #{paytypecode,jdbcType=VARCHAR}, #{paytypename,jdbcType=VARCHAR}, 
      #{alias,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMercOrderToken">
    insert into tb_pluss_merc_order_token
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="token != null">
        token,
      </if>
      <if test="merchantname != null">
        merchantName,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="orderamt != null">
        orderAmt,
      </if>
      <if test="ordernumber != null">
        orderNumber,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="snno != null">
        snNo,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="expiretime != null">
        expireTime,
      </if>
      <if test="mercorderno != null">
        mercOrderNo,
      </if>
      <if test="mercnotifyurl != null">
        mercNotifyUrl,
      </if>
      <if test="mercrefundurl != null">
        mercRefundUrl,
      </if>
      <if test="subject != null">
        subject,
      </if>
      <if test="channel != null">
        channel,
      </if>
      <if test="paytypecode != null">
        payTypeCode,
      </if>
      <if test="paytypename != null">
        payTypeName,
      </if>
      <if test="alias != null">
        alias,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="token != null">
        #{token,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="orderamt != null">
        #{orderamt,jdbcType=DECIMAL},
      </if>
      <if test="ordernumber != null">
        #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="snno != null">
        #{snno,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="expiretime != null">
        #{expiretime,jdbcType=TIMESTAMP},
      </if>
      <if test="mercorderno != null">
        #{mercorderno,jdbcType=VARCHAR},
      </if>
      <if test="mercnotifyurl != null">
        #{mercnotifyurl,jdbcType=VARCHAR},
      </if>
      <if test="mercrefundurl != null">
        #{mercrefundurl,jdbcType=VARCHAR},
      </if>
      <if test="subject != null">
        #{subject,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        #{channel,jdbcType=INTEGER},
      </if>
      <if test="paytypecode != null">
        #{paytypecode,jdbcType=VARCHAR},
      </if>
      <if test="paytypename != null">
        #{paytypename,jdbcType=VARCHAR},
      </if>
      <if test="alias != null">
        #{alias,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMercOrderToken">
    update tb_pluss_merc_order_token
    <set>
      <if test="token != null">
        token = #{token,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        merchantName = #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="orderamt != null">
        orderAmt = #{orderamt,jdbcType=DECIMAL},
      </if>
      <if test="ordernumber != null">
        orderNumber = #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="snno != null">
        snNo = #{snno,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="expiretime != null">
        expireTime = #{expiretime,jdbcType=TIMESTAMP},
      </if>
      <if test="mercorderno != null">
        mercOrderNo = #{mercorderno,jdbcType=VARCHAR},
      </if>
      <if test="mercnotifyurl != null">
        mercNotifyUrl = #{mercnotifyurl,jdbcType=VARCHAR},
      </if>
      <if test="mercrefundurl != null">
        mercRefundUrl = #{mercrefundurl,jdbcType=VARCHAR},
      </if>
      <if test="subject != null">
        subject = #{subject,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        channel = #{channel,jdbcType=INTEGER},
      </if>
      <if test="paytypecode != null">
        payTypeCode = #{paytypecode,jdbcType=VARCHAR},
      </if>
      <if test="paytypename != null">
        payTypeName = #{paytypename,jdbcType=VARCHAR},
      </if>
      <if test="alias != null">
        alias = #{alias,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMercOrderToken">
    update tb_pluss_merc_order_token
    set token = #{token,jdbcType=VARCHAR},
      merchantName = #{merchantname,jdbcType=VARCHAR},
      merchantCode = #{merchantcode,jdbcType=VARCHAR},
      userId = #{userid,jdbcType=INTEGER},
      orderAmt = #{orderamt,jdbcType=DECIMAL},
      orderNumber = #{ordernumber,jdbcType=VARCHAR},
      type = #{type,jdbcType=VARCHAR},
      snNo = #{snno,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      expireTime = #{expiretime,jdbcType=TIMESTAMP},
      mercOrderNo = #{mercorderno,jdbcType=VARCHAR},
      mercNotifyUrl = #{mercnotifyurl,jdbcType=VARCHAR},
      mercRefundUrl = #{mercrefundurl,jdbcType=VARCHAR},
      subject = #{subject,jdbcType=VARCHAR},
      channel = #{channel,jdbcType=INTEGER},
      payTypeCode = #{paytypecode,jdbcType=VARCHAR},
      payTypeName = #{paytypename,jdbcType=VARCHAR},
      alias = #{alias,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>