<?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.neusoft.smart.pos.payorder.persistent.mapper.PayOrderMapper">
  <resultMap id="BaseResultMap" type="com.neusoft.smart.pos.payorder.persistent.domain.PayOrder">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="mcode" jdbcType="VARCHAR" property="mcode" />
    <result column="m_order_number" jdbcType="VARCHAR" property="mOrderNumber" />
    <result column="trade_id" jdbcType="VARCHAR" property="tradeId" />
    <result column="outer_order_number" jdbcType="VARCHAR" property="outerOrderNumber" />
    <result column="device_id" jdbcType="VARCHAR" property="deviceId" />
    <result column="device_name" jdbcType="VARCHAR" property="deviceName" />
    <result column="description" jdbcType="VARCHAR" property="description" />
    <result column="pay_type" jdbcType="VARCHAR" property="payType" />
    <result column="pay_type_name" jdbcType="VARCHAR" property="payTypeName" />
    <result column="pay_amount" jdbcType="DECIMAL" property="payAmount" />
    <result column="notify_url" jdbcType="VARCHAR" property="notifyUrl" />
    <result column="time_expire" jdbcType="VARCHAR" property="timeExpire" />
    <result column="pay_status" jdbcType="CHAR" property="payStatus" />
    <result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
    <result column="version" jdbcType="INTEGER" property="version" />
    <result column="scan_code" jdbcType="VARCHAR" property="scanCode" />
    <result column="code_url" jdbcType="VARCHAR" property="codeUrl" />
    <result column="pid" jdbcType="VARCHAR" property="pid" />
    <result column="store_id" jdbcType="VARCHAR" property="storeId" />
    <result column="pay_ip" jdbcType="VARCHAR" property="payIp" />
    <result column="open_id" jdbcType="VARCHAR" property="openId" />
    <result column="trade_type" jdbcType="VARCHAR" property="tradeType" />
    <result column="member_card_no" jdbcType="VARCHAR" property="memberCardNo" />
    <result column="member_name" jdbcType="VARCHAR" property="memberName" />
    <result column="card_num" jdbcType="VARCHAR" property="cardNum" />
    <result column="card_hid_code" jdbcType="VARCHAR" property="cardHidCode" />
    <result column="retrvl_ref_no" jdbcType="VARCHAR" property="retrvlRefNo" />
    <result column="ori_trace_no" jdbcType="VARCHAR" property="oriTraceNo" />
    <result column="ori_batch_no" jdbcType="VARCHAR" property="oriBatchNo" />
    <result column="trans_date" jdbcType="VARCHAR" property="transDate" />
    <result column="request_detail_info" jdbcType="VARCHAR" property="requestDetailInfo" />
    <result column="response_detail_info" jdbcType="VARCHAR" property="responseDetailInfo" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="created_by" jdbcType="VARCHAR" property="createdBy" />
    <result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, mcode, m_order_number, trade_id, outer_order_number, device_id, device_name,
    description, pay_type, pay_type_name, pay_amount,
    notify_url, time_expire, pay_status, pay_time, version, scan_code, code_url,
    pid, store_id, pay_ip, open_id, trade_type, member_card_no, member_name, card_num, card_hid_code,
    retrvl_ref_no, ori_trace_no, ori_batch_no, trans_date, request_detail_info, response_detail_info,
    created_at, created_by, updated_by, updated_at
  </sql>
  <select id="selectByExample" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayOrderExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from pay_order_v2
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="offset != null and limit != null">
      limit ${offset}, ${limit}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from pay_order_v2
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from pay_order_v2
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayOrderExample">
    delete from pay_order_v2
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayOrder" useGeneratedKeys="true">
    insert into pay_order_v2 (mcode, m_order_number, trade_id,
      outer_order_number, device_id, device_name, description,
      pay_type, pay_type_name, pay_amount, notify_url,
      time_expire, pay_status, pay_time, version,
      scan_code, code_url, pid, store_id, pay_ip,
      open_id, trade_type, member_card_no, member_name,
      card_num, card_hid_code, retrvl_ref_no, ori_trace_no,
      ori_batch_no, trans_date, request_detail_info, response_detail_info,
      created_at, created_by, updated_by, updated_at
      )
    values (#{mcode,jdbcType=VARCHAR}, #{mOrderNumber,jdbcType=VARCHAR}, #{tradeId,jdbcType=VARCHAR}, 
      #{outerOrderNumber,jdbcType=VARCHAR}, #{deviceId,jdbcType=VARCHAR}, #{deviceName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{payType,jdbcType=VARCHAR},
      #{payType,jdbcType=VARCHAR}, #{payTypeName,jdbcType=VARCHAR}, #{payAmount,jdbcType=DECIMAL}, #{notifyUrl,jdbcType=VARCHAR}, #{orderStatus,jdbcType=CHAR},
      #{timeExpire,jdbcType=VARCHAR}, #{payStatus,jdbcType=CHAR}, #{payTime,jdbcType=TIMESTAMP}, #{version,jdbcType=INTEGER},
      #{scanCode,jdbcType=VARCHAR}, #{codeUrl,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{storeId,jdbcType=VARCHAR}, #{payIp,jdbcType=VARCHAR},
      #{openId,jdbcType=VARCHAR}, #{tradeType,jdbcType=VARCHAR}, #{memberCardNo,jdbcType=VARCHAR}, #{memberName,jdbcType=VARCHAR},
      #{cardNum,jdbcType=VARCHAR}, #{cardHidCode,jdbcType=VARCHAR}, #{retrvlRefNo,jdbcType=VARCHAR}, #{oriTraceNo,jdbcType=VARCHAR},
      #{oriBatchNo,jdbcType=VARCHAR}, #{transDate,jdbcType=VARCHAR}, #{requestDetailInfo,jdbcType=VARCHAR}, #{responseDetailInfo,jdbcType=VARCHAR},
      #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR}, #{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayOrder" useGeneratedKeys="true">
    insert into pay_order_v2
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="mcode != null">
        mcode,
      </if>
      <if test="mOrderNumber != null">
        m_order_number,
      </if>
      <if test="tradeId != null">
        trade_id,
      </if>
      <if test="outerOrderNumber != null">
        outer_order_number,
      </if>
      <if test="deviceId != null">
        device_id,
      </if>
      <if test="deviceName != null">
        device_name,
      </if>
      <if test="description != null">
        description,
      </if>
      <if test="payType != null">
        pay_type,
      </if>
      <if test="payTypeName != null">
        pay_type_name,
      </if>
      <if test="payAmount != null">
        pay_amount,
      </if>
      <if test="notifyUrl != null">
        notify_url,
      </if>
      <if test="timeExpire != null">
        time_expire,
      </if>
      <if test="payStatus != null">
        pay_status,
      </if>
      <if test="payTime != null">
        pay_time,
      </if>
      <if test="version != null">
        version,
      </if>
      <if test="scanCode != null">
        scan_code,
      </if>
      <if test="codeUrl != null">
        code_url,
      </if>
      <if test="pid != null">
        pid,
      </if>
      <if test="storeId != null">
        store_id,
      </if>
      <if test="payIp != null">
        pay_ip,
      </if>
      <if test="openId != null">
        open_id,
      </if>
      <if test="tradeType != null">
        trade_type,
      </if>
      <if test="memberCardNo != null">
        member_card_no,
      </if>
      <if test="memberName != null">
        member_name,
      </if>
      <if test="cardNum != null">
        card_num,
      </if>
      <if test="cardHidCode != null">
        card_hid_code,
      </if>
      <if test="retrvlRefNo != null">
        retrvl_ref_no,
      </if>
      <if test="oriTraceNo != null">
        ori_trace_no,
      </if>
      <if test="oriBatchNo != null">
        ori_batch_no,
      </if>
      <if test="transDate != null">
        trans_date,
      </if>
      <if test="requestDetailInfo != null">
        request_detail_info,
      </if>
      <if test="responseDetailInfo != null">
        response_detail_info,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="updatedBy != null">
        updated_by,
      </if>
      <if test="updatedAt != null">
        updated_at,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="mcode != null">
        #{mcode,jdbcType=VARCHAR},
      </if>
      <if test="mOrderNumber != null">
        #{mOrderNumber,jdbcType=VARCHAR},
      </if>
      <if test="tradeId != null">
        #{tradeId,jdbcType=VARCHAR},
      </if>
      <if test="outerOrderNumber != null">
        #{outerOrderNumber,jdbcType=VARCHAR},
      </if>
      <if test="deviceId != null">
        #{deviceId,jdbcType=VARCHAR},
      </if>
      <if test="deviceName != null">
        #{deviceName,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        #{payType,jdbcType=VARCHAR},
      </if>
      <if test="payTypeName != null">
        #{payTypeName,jdbcType=VARCHAR},
      </if>
      <if test="payAmount != null">
        #{payAmount,jdbcType=DECIMAL},
      </if>
      <if test="notifyUrl != null">
        #{notifyUrl,jdbcType=VARCHAR},
      </if>
      <if test="timeExpire != null">
        #{timeExpire,jdbcType=VARCHAR},
      </if>
      <if test="payStatus != null">
        #{payStatus,jdbcType=CHAR},
      </if>
      <if test="payTime != null">
        #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="version != null">
        #{version,jdbcType=INTEGER},
      </if>
      <if test="scanCode != null">
        #{scanCode,jdbcType=VARCHAR},
      </if>
      <if test="codeUrl != null">
        #{codeUrl,jdbcType=VARCHAR},
      </if>
      <if test="pid != null">
        #{pid,jdbcType=VARCHAR},
      </if>
      <if test="storeId != null">
        #{storeId,jdbcType=VARCHAR},
      </if>
      <if test="payIp != null">
        #{payIp,jdbcType=VARCHAR},
      </if>
      <if test="openId != null">
        #{openId,jdbcType=VARCHAR},
      </if>
      <if test="tradeType != null">
        #{tradeType,jdbcType=VARCHAR},
      </if>
      <if test="memberCardNo != null">
        #{memberCardNo,jdbcType=VARCHAR},
      </if>
      <if test="memberName != null">
        #{memberName,jdbcType=VARCHAR},
      </if>
      <if test="cardNum != null">
        #{cardNum,jdbcType=VARCHAR},
      </if>
      <if test="cardHidCode != null">
        #{cardHidCode,jdbcType=VARCHAR},
      </if>
      <if test="retrvlRefNo != null">
         #{retrvlRefNo,jdbcType=VARCHAR},
      </if>
      <if test="oriTraceNo != null">
         #{oriTraceNo,jdbcType=VARCHAR},
      </if>
      <if test="oriBatchNo != null">
         #{oriBatchNo,jdbcType=VARCHAR},
      </if>
      <if test="transDate != null">
        #{transDate,jdbcType=VARCHAR},
      </if>
      <if test="requestDetailInfo != null">
        #{requestDetailInfo,jdbcType=VARCHAR},
      </if>
      <if test="responseDetailInfo != null">
        #{responseDetailInfo,jdbcType=VARCHAR},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedBy != null">
        #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedAt != null">
        #{updatedAt,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayOrderExample" resultType="java.lang.Integer">
    select count(*) from pay_order_v2
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update pay_order_v2
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.mcode != null">
        mcode = #{record.mcode,jdbcType=VARCHAR},
      </if>
      <if test="record.mOrderNumber != null">
        m_order_number = #{record.mOrderNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.tradeId != null">
        trade_id = #{record.tradeId,jdbcType=VARCHAR},
      </if>
      <if test="record.outerOrderNumber != null">
        outer_order_number = #{record.outerOrderNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.deviceId != null">
        device_id = #{record.deviceId,jdbcType=VARCHAR},
      </if>
      <if test="record.deviceName != null">
        device_name = #{record.deviceName,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        description = #{record.description,jdbcType=VARCHAR},
      </if>
      <if test="record.payType != null">
        pay_type = #{record.payType,jdbcType=VARCHAR},
      </if>
      <if test="record.payTypeName != null">
        pay_type_name = #{record.payTypeName,jdbcType=VARCHAR},
      </if>
      <if test="record.payAmount != null">
        order_amount = #{record.payAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.notifyUrl != null">
        notify_url = #{record.notifyUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.timeExpire != null">
        time_expire = #{record.timeExpire,jdbcType=VARCHAR},
      </if>
      <if test="record.payStatus != null">
        pay_status = #{record.payStatus,jdbcType=CHAR},
      </if>
      <if test="record.payTime != null">
        pay_time = #{record.payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.version != null">
        version = #{record.version,jdbcType=INTEGER},
      </if>
      <if test="record.scanCode != null">
        scan_code = #{record.scanCode,jdbcType=VARCHAR},
      </if>
      <if test="record.codeUrl != null">
        code_url = #{record.codeUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.pid != null">
        pid = #{record.pid,jdbcType=VARCHAR},
      </if>
      <if test="record.storeId != null">
        store_id = #{record.storeId,jdbcType=VARCHAR},
      </if>
      <if test="record.payIp != null">
        pay_ip = #{record.payIp,jdbcType=VARCHAR},
      </if>
      <if test="record.openId != null">
        open_id = #{record.openId,jdbcType=VARCHAR},
      </if>
      <if test="record.tradeType != null">
        trade_type = #{record.tradeType,jdbcType=VARCHAR},
      </if>
      <if test="record.memberCardNo != null">
        member_card_no = #{record.memberCardNo,jdbcType=VARCHAR},
      </if>
      <if test="record.memberName != null">
        member_name = #{record.memberName,jdbcType=VARCHAR},
      </if>
      <if test="record.cardNum != null">
        card_num = #{record.cardNum,jdbcType=VARCHAR},
      </if>
      <if test="record.cardHidCode != null">
        card_hid_code = #{record.cardHidCode,jdbcType=VARCHAR},
      </if>
      <if test="record.retrvlRefNo != null">
        retrvl_ref_no = #{record.retrvlRefNo,jdbcType=VARCHAR},
      </if>
      <if test="record.oriTraceNo != null">
        ori_trace_no = #{record.oriTraceNo,jdbcType=VARCHAR},
      </if>
      <if test="record.oriBatchNo != null">
        ori_batch_no = #{record.oriBatchNo,jdbcType=VARCHAR},
      </if>
      <if test="record.transDate != null">
        trans_date = #{record.transDate,jdbcType=VARCHAR},
      </if>
      <if test="record.requestDetailInfo != null">
        request_detail_info = #{record.requestDetailInfo,jdbcType=VARCHAR},
      </if>
      <if test="record.responseDetailInfo != null">
        response_detail_info = #{record.responseDetailInfo,jdbcType=VARCHAR},
      </if>
      <if test="record.createdAt != null">
        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createdBy != null">
        created_by = #{record.createdBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updatedBy != null">
        updated_by = #{record.updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updatedAt != null">
        updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update pay_order_v2
    set id = #{record.id,jdbcType=INTEGER},
      mcode = #{record.mcode,jdbcType=VARCHAR},
      m_order_number = #{record.mOrderNumber,jdbcType=VARCHAR},
      trade_id = #{record.tradeId,jdbcType=VARCHAR},
      outer_order_number = #{record.outerOrderNumber,jdbcType=VARCHAR},
      device_id = #{record.deviceId,jdbcType=VARCHAR},
      device_name = #{record.deviceName,jdbcType=VARCHAR},
      description = #{record.description,jdbcType=VARCHAR},
      pay_type = #{record.payType,jdbcType=VARCHAR},
      pay_type_name = #{record.payTypeName,jdbcType=VARCHAR},
      pay_amount = #{record.payAmount,jdbcType=DECIMAL},
      notify_url = #{record.notifyUrl,jdbcType=VARCHAR},
      time_expire = #{record.timeExpire,jdbcType=VARCHAR},
      pay_status = #{record.payStatus,jdbcType=CHAR},
      pay_time = #{record.payTime,jdbcType=TIMESTAMP},
      version = #{record.version,jdbcType=INTEGER},
      scan_code = #{record.scanCode,jdbcType=VARCHAR},
      code_url = #{record.codeUrl,jdbcType=VARCHAR},
      pid = #{record.pid,jdbcType=VARCHAR},
      store_id = #{record.storeId,jdbcType=VARCHAR},
      pay_ip = #{record.payIp,jdbcType=VARCHAR},
      open_id = #{record.openId,jdbcType=VARCHAR},
      trade_type = #{record.tradeType,jdbcType=VARCHAR},
      member_card_no = #{record.memberCardNo,jdbcType=VARCHAR},
      member_name = #{record.memberName,jdbcType=VARCHAR},
      card_num = #{record.cardNum,jdbcType=VARCHAR},
      card_hid_code = #{record.cardHidCode,jdbcType=VARCHAR},
      retrvl_ref_no = #{record.retrvlRefNo,jdbcType=VARCHAR},
      ori_trace_no = #{record.oriTraceNo,jdbcType=VARCHAR},
      ori_batch_no = #{record.oriBatchNo,jdbcType=VARCHAR},
      trans_date = #{record.transDate,jdbcType=VARCHAR},
      request_detail_info = #{record.requestDetailInfo,jdbcType=VARCHAR},
      response_detail_info = #{record.responseDetailInfo,jdbcType=VARCHAR},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=VARCHAR},
      updated_by = #{record.updatedBy,jdbcType=VARCHAR},
      updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayOrder">
    update pay_order_v2
    <set>
      <if test="mcode != null">
        mcode = #{mcode,jdbcType=VARCHAR},
      </if>
      <if test="mOrderNumber != null">
        m_order_number = #{mOrderNumber,jdbcType=VARCHAR},
      </if>
      <if test="tradeId != null">
        trade_id = #{tradeId,jdbcType=VARCHAR},
      </if>
      <if test="outerOrderNumber != null">
        outer_order_number = #{outerOrderNumber,jdbcType=VARCHAR},
      </if>
      <if test="deviceId != null">
        device_id = #{deviceId,jdbcType=VARCHAR},
      </if>
      <if test="deviceName != null">
        device_name = #{deviceName,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        pay_type = #{payType,jdbcType=VARCHAR},
      </if>
      <if test="payTypeName != null">
        pay_type_name = #{payTypeName,jdbcType=VARCHAR},
      </if>
      <if test="payAmount != null">
        pay_amount = #{payAmount,jdbcType=DECIMAL},
      </if>
      <if test="notifyUrl != null">
        notify_url = #{notifyUrl,jdbcType=VARCHAR},
      </if>
      <if test="timeExpire != null">
        time_expire = #{timeExpire,jdbcType=VARCHAR},
      </if>
      <if test="payStatus != null">
        pay_status = #{payStatus,jdbcType=CHAR},
      </if>
      <if test="payTime != null">
        pay_time = #{payTime,jdbcType=TIMESTAMP},
      </if>
      <if test="version != null">
        version = #{version,jdbcType=INTEGER},
      </if>
      <if test="scanCode != null">
        scan_code = #{scanCode,jdbcType=VARCHAR},
      </if>
      <if test="codeUrl != null">
        code_url = #{codeUrl,jdbcType=VARCHAR},
      </if>
      <if test="pid != null">
        pid = #{pid,jdbcType=VARCHAR},
      </if>
      <if test="storeId != null">
        store_id = #{storeId,jdbcType=VARCHAR},
      </if>
      <if test="payIp != null">
        pay_ip = #{payIp,jdbcType=VARCHAR},
      </if>
      <if test="openId != null">
        open_id = #{openId,jdbcType=VARCHAR},
      </if>
      <if test="tradeType != null">
        trade_type = #{tradeType,jdbcType=VARCHAR},
      </if>
      <if test="memberCardNo != null">
        member_card_no = #{memberCardNo,jdbcType=VARCHAR},
      </if>
      <if test="memberName != null">
        member_name = #{memberName,jdbcType=VARCHAR},
      </if>
      <if test="cardNum != null">
        card_num = #{cardNum,jdbcType=VARCHAR},
      </if>
      <if test="cardHidCode != null">
        card_hid_code = #{cardHidCode,jdbcType=VARCHAR},
      </if>
      <if test="retrvlRefNo != null">
        retrvl_ref_no = #{retrvlRefNo,jdbcType=VARCHAR},
      </if>
      <if test="oriTraceNo != null">
        ori_trace_no = #{oriTraceNo,jdbcType=VARCHAR},
      </if>
      <if test="oriBatchNo != null">
        ori_batch_no = #{oriBatchNo,jdbcType=VARCHAR},
      </if>
      <if test="transDate != null">
        trans_date = #{transDate,jdbcType=VARCHAR},
      </if>
      <if test="requestDetailInfo != null">
        request_detail_info = #{requestDetailInfo,jdbcType=VARCHAR},
      </if>
      <if test="responseDetailInfo != null">
        response_detail_info = #{responseDetailInfo,jdbcType=VARCHAR},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedBy != null">
        updated_by = #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedAt != null">
        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayOrder">
    update pay_order_v2
    set mcode = #{mcode,jdbcType=VARCHAR},
      m_order_number = #{mOrderNumber,jdbcType=VARCHAR},
      trade_id = #{tradeId,jdbcType=VARCHAR},
      outer_order_number = #{outerOrderNumber,jdbcType=VARCHAR},
      device_id = #{deviceId,jdbcType=VARCHAR},
      device_name = #{deviceName,jdbcType=VARCHAR},
      description = #{description,jdbcType=VARCHAR},
      pay_type = #{payType,jdbcType=VARCHAR},
      pay_type_name = #{payTypeName,jdbcType=VARCHAR},
      pay_amount = #{payAmount,jdbcType=DECIMAL},
      notify_url = #{notifyUrl,jdbcType=VARCHAR},
      time_expire = #{timeExpire,jdbcType=VARCHAR},
      pay_status = #{payStatus,jdbcType=CHAR},
      pay_time = #{payTime,jdbcType=TIMESTAMP},
      version = #{version,jdbcType=INTEGER},
      scan_code = #{scanCode,jdbcType=VARCHAR},
      code_url = #{codeUrl,jdbcType=VARCHAR},
      pid = #{pid,jdbcType=VARCHAR},
      store_id = #{storeId,jdbcType=VARCHAR},
      pay_ip = #{payIp,jdbcType=VARCHAR},
      open_id = #{openId,jdbcType=VARCHAR},
      trade_type = #{tradeType,jdbcType=VARCHAR},
      member_card_no = #{memberCardNo,jdbcType=VARCHAR},
      member_name = #{memberName,jdbcType=VARCHAR},
      card_num = #{cardNum,jdbcType=VARCHAR},
      card_hid_code = #{cardHidCode,jdbcType=VARCHAR},
      retrvl_ref_no = #{retrvlRefNo,jdbcType=VARCHAR},
      ori_trace_no = #{oriTraceNo,jdbcType=VARCHAR},
      ori_batch_no = #{oriBatchNo,jdbcType=VARCHAR},
      trans_date = #{transDate,jdbcType=VARCHAR},
      request_detail_info = #{requestDetailInfo,jdbcType=VARCHAR},
      response_detail_info = #{responseDetailInfo,jdbcType=VARCHAR},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=VARCHAR},
      updated_by = #{updatedBy,jdbcType=VARCHAR},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="batchInsert">
    <if test="items.get(0) != null">
            insert into pay_order_v2  (mcode, m_order_number, trade_id,
        outer_order_number, device_id, device_name, description,
        pay_type, pay_type_name, pay_amount, notify_url,
        time_expire, pay_status, pay_time, version,
        scan_code, code_url, pid, store_id, pay_ip,
        open_id, trade_type, member_card_no, member_name,
        card_num, card_hid_code, retrvl_ref_no, ori_trace_no,
        ori_batch_no, trans_date, request_detail_info, response_detail_info,
        created_at, created_by, updated_by, updated_at
        )
      values
      <foreach collection="items" item="item" index="index" separator=",">
      (#{item.mcode,jdbcType=VARCHAR}, #{item.mOrderNumber,jdbcType=VARCHAR}, #{item.tradeId,jdbcType=VARCHAR}, 
        #{item.outerOrderNumber,jdbcType=VARCHAR}, #{item.deviceId,jdbcType=VARCHAR}, #{item.deviceName,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR},
        #{item.payType,jdbcType=VARCHAR}, #{item.payTypeName,jdbcType=VARCHAR}, #{item.payAmount,jdbcType=DECIMAL}, #{item.notifyUrl,jdbcType=VARCHAR},
        #{item.timeExpire,jdbcType=VARCHAR}, #{item.payStatus,jdbcType=CHAR}, #{item.payTime,jdbcType=TIMESTAMP}, #{item.version,jdbcType=INTEGER},
        #{item.scanCode,jdbcType=VARCHAR}, #{item.codeUrl,jdbcType=VARCHAR}, #{item.pid,jdbcType=VARCHAR}, #{item.storeId,jdbcType=VARCHAR}, #{item.payIp,jdbcType=VARCHAR},
        #{item.openId,jdbcType=VARCHAR}, #{item.tradeType,jdbcType=VARCHAR}, #{item.memberCardNo,jdbcType=VARCHAR}, #{item.memberName,jdbcType=VARCHAR},
        #{item.cardNum,jdbcType=VARCHAR}, #{item.cardHidCode,jdbcType=VARCHAR}, #{item.retrvlRefNo,jdbcType=VARCHAR}, #{item.oriTraceNo,jdbcType=VARCHAR},
        #{item.oriBatchNo,jdbcType=VARCHAR}, #{item.transDate,jdbcType=VARCHAR}, #{item.requestDetailInfo,jdbcType=VARCHAR}, #{item.responseDetailInfo,jdbcType=VARCHAR},
        #{item.createdAt,jdbcType=TIMESTAMP}, #{item.createdBy,jdbcType=VARCHAR}, #{item.updatedBy,jdbcType=VARCHAR}, #{item.updatedAt,jdbcType=TIMESTAMP}
        )
      </foreach>
    </if>
  </insert>
</mapper>