<?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.TbPlussMercOrderNewMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMercOrderNew">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="orderNo" jdbcType="VARCHAR" property="orderno" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="transNo" jdbcType="VARCHAR" property="transno" />
    <result column="thirdTransNo" jdbcType="VARCHAR" property="thirdtransno" />
    <result column="receiver" jdbcType="VARCHAR" property="receiver" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="province" jdbcType="VARCHAR" property="province" />
    <result column="city" jdbcType="VARCHAR" property="city" />
    <result column="district" jdbcType="VARCHAR" property="district" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="creator" jdbcType="INTEGER" property="creator" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
    <result column="updater" jdbcType="INTEGER" property="updater" />
    <result column="payType" jdbcType="VARCHAR" property="paytype" />
    <result column="transDt" jdbcType="TIMESTAMP" property="transdt" />
    <result column="orderAmt" jdbcType="DECIMAL" property="orderamt" />
    <result column="discountAmt" jdbcType="DECIMAL" property="discountamt" />
    <result column="actualAmt" jdbcType="DECIMAL" property="actualamt" />
    <result column="postage" jdbcType="DECIMAL" property="postage" />
    <result column="areaName" jdbcType="VARCHAR" property="areaname" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="merchantName" jdbcType="VARCHAR" property="merchantname" />
    <result column="channel" jdbcType="INTEGER" property="channel" />
    <result column="payData" jdbcType="VARCHAR" property="paydata" />
    <result column="payUserId" jdbcType="VARCHAR" property="payuserid" />
    <result column="refund_desc" jdbcType="VARCHAR" property="refundDesc" />
    <result column="refund_img" jdbcType="VARCHAR" property="refundImg" />
    <result column="refund_time" jdbcType="TIMESTAMP" property="refundTime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, orderNo, userId, transNo, thirdTransNo, receiver, phone, province, city, district, 
    address, remark, status, createTime, creator, updateTime, updater, payType, transDt, 
    orderAmt, discountAmt, actualAmt, postage, areaName, merchantCode, merchantName, 
    channel, payData, payUserId, refund_desc, refund_img, refund_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merc_order_new
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merc_order_new
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMercOrderNew">
    insert into tb_pluss_merc_order_new (id, orderNo, userId, 
      transNo, thirdTransNo, receiver, 
      phone, province, city, 
      district, address, remark, 
      status, createTime, creator, 
      updateTime, updater, payType, 
      transDt, orderAmt, discountAmt, 
      actualAmt, postage, areaName, 
      merchantCode, merchantName, channel, 
      payData, payUserId, refund_desc, 
      refund_img, refund_time)
    values (#{id,jdbcType=INTEGER}, #{orderno,jdbcType=VARCHAR}, #{userid,jdbcType=INTEGER}, 
      #{transno,jdbcType=VARCHAR}, #{thirdtransno,jdbcType=VARCHAR}, #{receiver,jdbcType=VARCHAR}, 
      #{phone,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, 
      #{district,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
      #{status,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{creator,jdbcType=INTEGER}, 
      #{updatetime,jdbcType=TIMESTAMP}, #{updater,jdbcType=INTEGER}, #{paytype,jdbcType=VARCHAR}, 
      #{transdt,jdbcType=TIMESTAMP}, #{orderamt,jdbcType=DECIMAL}, #{discountamt,jdbcType=DECIMAL}, 
      #{actualamt,jdbcType=DECIMAL}, #{postage,jdbcType=DECIMAL}, #{areaname,jdbcType=VARCHAR}, 
      #{merchantcode,jdbcType=VARCHAR}, #{merchantname,jdbcType=VARCHAR}, #{channel,jdbcType=INTEGER}, 
      #{paydata,jdbcType=VARCHAR}, #{payuserid,jdbcType=VARCHAR}, #{refundDesc,jdbcType=VARCHAR}, 
      #{refundImg,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMercOrderNew">
    insert into tb_pluss_merc_order_new
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="orderno != null">
        orderNo,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="transno != null">
        transNo,
      </if>
      <if test="thirdtransno != null">
        thirdTransNo,
      </if>
      <if test="receiver != null">
        receiver,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="province != null">
        province,
      </if>
      <if test="city != null">
        city,
      </if>
      <if test="district != null">
        district,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="creator != null">
        creator,
      </if>
      <if test="updatetime != null">
        updateTime,
      </if>
      <if test="updater != null">
        updater,
      </if>
      <if test="paytype != null">
        payType,
      </if>
      <if test="transdt != null">
        transDt,
      </if>
      <if test="orderamt != null">
        orderAmt,
      </if>
      <if test="discountamt != null">
        discountAmt,
      </if>
      <if test="actualamt != null">
        actualAmt,
      </if>
      <if test="postage != null">
        postage,
      </if>
      <if test="areaname != null">
        areaName,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="merchantname != null">
        merchantName,
      </if>
      <if test="channel != null">
        channel,
      </if>
      <if test="paydata != null">
        payData,
      </if>
      <if test="payuserid != null">
        payUserId,
      </if>
      <if test="refundDesc != null">
        refund_desc,
      </if>
      <if test="refundImg != null">
        refund_img,
      </if>
      <if test="refundTime != null">
        refund_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="orderno != null">
        #{orderno,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="transno != null">
        #{transno,jdbcType=VARCHAR},
      </if>
      <if test="thirdtransno != null">
        #{thirdtransno,jdbcType=VARCHAR},
      </if>
      <if test="receiver != null">
        #{receiver,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="province != null">
        #{province,jdbcType=VARCHAR},
      </if>
      <if test="city != null">
        #{city,jdbcType=VARCHAR},
      </if>
      <if test="district != null">
        #{district,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="creator != null">
        #{creator,jdbcType=INTEGER},
      </if>
      <if test="updatetime != null">
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="updater != null">
        #{updater,jdbcType=INTEGER},
      </if>
      <if test="paytype != null">
        #{paytype,jdbcType=VARCHAR},
      </if>
      <if test="transdt != null">
        #{transdt,jdbcType=TIMESTAMP},
      </if>
      <if test="orderamt != null">
        #{orderamt,jdbcType=DECIMAL},
      </if>
      <if test="discountamt != null">
        #{discountamt,jdbcType=DECIMAL},
      </if>
      <if test="actualamt != null">
        #{actualamt,jdbcType=DECIMAL},
      </if>
      <if test="postage != null">
        #{postage,jdbcType=DECIMAL},
      </if>
      <if test="areaname != null">
        #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        #{channel,jdbcType=INTEGER},
      </if>
      <if test="paydata != null">
        #{paydata,jdbcType=VARCHAR},
      </if>
      <if test="payuserid != null">
        #{payuserid,jdbcType=VARCHAR},
      </if>
      <if test="refundDesc != null">
        #{refundDesc,jdbcType=VARCHAR},
      </if>
      <if test="refundImg != null">
        #{refundImg,jdbcType=VARCHAR},
      </if>
      <if test="refundTime != null">
        #{refundTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMercOrderNew">
    update tb_pluss_merc_order_new
    <set>
      <if test="orderno != null">
        orderNo = #{orderno,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="transno != null">
        transNo = #{transno,jdbcType=VARCHAR},
      </if>
      <if test="thirdtransno != null">
        thirdTransNo = #{thirdtransno,jdbcType=VARCHAR},
      </if>
      <if test="receiver != null">
        receiver = #{receiver,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="province != null">
        province = #{province,jdbcType=VARCHAR},
      </if>
      <if test="city != null">
        city = #{city,jdbcType=VARCHAR},
      </if>
      <if test="district != null">
        district = #{district,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="creator != null">
        creator = #{creator,jdbcType=INTEGER},
      </if>
      <if test="updatetime != null">
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="updater != null">
        updater = #{updater,jdbcType=INTEGER},
      </if>
      <if test="paytype != null">
        payType = #{paytype,jdbcType=VARCHAR},
      </if>
      <if test="transdt != null">
        transDt = #{transdt,jdbcType=TIMESTAMP},
      </if>
      <if test="orderamt != null">
        orderAmt = #{orderamt,jdbcType=DECIMAL},
      </if>
      <if test="discountamt != null">
        discountAmt = #{discountamt,jdbcType=DECIMAL},
      </if>
      <if test="actualamt != null">
        actualAmt = #{actualamt,jdbcType=DECIMAL},
      </if>
      <if test="postage != null">
        postage = #{postage,jdbcType=DECIMAL},
      </if>
      <if test="areaname != null">
        areaName = #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        merchantName = #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        channel = #{channel,jdbcType=INTEGER},
      </if>
      <if test="paydata != null">
        payData = #{paydata,jdbcType=VARCHAR},
      </if>
      <if test="payuserid != null">
        payUserId = #{payuserid,jdbcType=VARCHAR},
      </if>
      <if test="refundDesc != null">
        refund_desc = #{refundDesc,jdbcType=VARCHAR},
      </if>
      <if test="refundImg != null">
        refund_img = #{refundImg,jdbcType=VARCHAR},
      </if>
      <if test="refundTime != null">
        refund_time = #{refundTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMercOrderNew">
    update tb_pluss_merc_order_new
    set orderNo = #{orderno,jdbcType=VARCHAR},
      userId = #{userid,jdbcType=INTEGER},
      transNo = #{transno,jdbcType=VARCHAR},
      thirdTransNo = #{thirdtransno,jdbcType=VARCHAR},
      receiver = #{receiver,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      province = #{province,jdbcType=VARCHAR},
      city = #{city,jdbcType=VARCHAR},
      district = #{district,jdbcType=VARCHAR},
      address = #{address,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      creator = #{creator,jdbcType=INTEGER},
      updateTime = #{updatetime,jdbcType=TIMESTAMP},
      updater = #{updater,jdbcType=INTEGER},
      payType = #{paytype,jdbcType=VARCHAR},
      transDt = #{transdt,jdbcType=TIMESTAMP},
      orderAmt = #{orderamt,jdbcType=DECIMAL},
      discountAmt = #{discountamt,jdbcType=DECIMAL},
      actualAmt = #{actualamt,jdbcType=DECIMAL},
      postage = #{postage,jdbcType=DECIMAL},
      areaName = #{areaname,jdbcType=VARCHAR},
      merchantCode = #{merchantcode,jdbcType=VARCHAR},
      merchantName = #{merchantname,jdbcType=VARCHAR},
      channel = #{channel,jdbcType=INTEGER},
      payData = #{paydata,jdbcType=VARCHAR},
      payUserId = #{payuserid,jdbcType=VARCHAR},
      refund_desc = #{refundDesc,jdbcType=VARCHAR},
      refund_img = #{refundImg,jdbcType=VARCHAR},
      refund_time = #{refundTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>