<?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.TradeMchPayChannelMapper">
  <resultMap id="BaseResultMap" type="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannel">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="org_id" jdbcType="INTEGER" property="orgId" />
    <result column="shop_id" jdbcType="INTEGER" property="shopId" />
    <result column="appid" jdbcType="VARCHAR" property="appid" />
    <result column="mch_id" jdbcType="VARCHAR" property="mchId" />
    <result column="sub_appid" jdbcType="VARCHAR" property="subAppid" />
    <result column="sub_mch_id" jdbcType="VARCHAR" property="subMchId" />
    <result column="secret_key" jdbcType="VARCHAR" property="secretKey" />
    <result column="app_secret_key" jdbcType="VARCHAR" property="appSecretKey" />
    <result column="private_key" jdbcType="VARCHAR" property="privateKey" />
    <result column="public_key" jdbcType="VARCHAR" property="publicKey" />
    <result column="pay_type" jdbcType="VARCHAR" property="payType" />
    <result column="image_url" jdbcType="VARCHAR" property="imageUrl" />
    <result column="version" jdbcType="INTEGER" property="version" />
    <result column="is_enable" jdbcType="CHAR" property="isEnable" />
    <result column="shop_no" jdbcType="VARCHAR" property="shopNo" />
    <result column="priority" jdbcType="TINYINT" property="priority" />
    <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" />
    <result column="scan_type" jdbcType="VARCHAR" property="scanType" />
    <result column="active_status" jdbcType="VARCHAR" property="activeStatus" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannel">
    <result column="cert" jdbcType="LONGVARBINARY" property="cert" />
  </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, org_id, shop_id, appid, mch_id, sub_appid, sub_mch_id, secret_key, app_secret_key, 
    private_key, public_key, pay_type, image_url, version, is_enable, shop_no, priority, 
    created_at, created_by, updated_by, updated_at, scan_type, active_status
  </sql>
  <sql id="Blob_Column_List">
    cert
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannelExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from trade_mch_pay_channel
    <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="selectByExample" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannelExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from trade_mch_pay_channel
    <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="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from trade_mch_pay_channel
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from trade_mch_pay_channel
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannelExample">
    delete from trade_mch_pay_channel
    <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.TradeMchPayChannel" useGeneratedKeys="true">
    insert into trade_mch_pay_channel (org_id, shop_id, appid, 
      mch_id, sub_appid, sub_mch_id, 
      secret_key, app_secret_key, private_key, 
      public_key, pay_type, image_url, 
      version, is_enable, shop_no, 
      priority, created_at, created_by, 
      updated_by, updated_at, scan_type, 
      active_status, cert)
    values (#{orgId,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{appid,jdbcType=VARCHAR}, 
      #{mchId,jdbcType=VARCHAR}, #{subAppid,jdbcType=VARCHAR}, #{subMchId,jdbcType=VARCHAR}, 
      #{secretKey,jdbcType=VARCHAR}, #{appSecretKey,jdbcType=VARCHAR}, #{privateKey,jdbcType=VARCHAR}, 
      #{publicKey,jdbcType=VARCHAR}, #{payType,jdbcType=VARCHAR}, #{imageUrl,jdbcType=VARCHAR}, 
      #{version,jdbcType=INTEGER}, #{isEnable,jdbcType=CHAR}, #{shopNo,jdbcType=VARCHAR}, 
      #{priority,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR}, 
      #{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{scanType,jdbcType=VARCHAR}, 
      #{activeStatus,jdbcType=VARCHAR}, #{cert,jdbcType=LONGVARBINARY})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannel" useGeneratedKeys="true">
    insert into trade_mch_pay_channel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="orgId != null">
        org_id,
      </if>
      <if test="shopId != null">
        shop_id,
      </if>
      <if test="appid != null">
        appid,
      </if>
      <if test="mchId != null">
        mch_id,
      </if>
      <if test="subAppid != null">
        sub_appid,
      </if>
      <if test="subMchId != null">
        sub_mch_id,
      </if>
      <if test="secretKey != null">
        secret_key,
      </if>
      <if test="appSecretKey != null">
        app_secret_key,
      </if>
      <if test="privateKey != null">
        private_key,
      </if>
      <if test="publicKey != null">
        public_key,
      </if>
      <if test="payType != null">
        pay_type,
      </if>
      <if test="imageUrl != null">
        image_url,
      </if>
      <if test="version != null">
        version,
      </if>
      <if test="isEnable != null">
        is_enable,
      </if>
      <if test="shopNo != null">
        shop_no,
      </if>
      <if test="priority != null">
        priority,
      </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>
      <if test="scanType != null">
        scan_type,
      </if>
      <if test="activeStatus != null">
        active_status,
      </if>
      <if test="cert != null">
        cert,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="orgId != null">
        #{orgId,jdbcType=INTEGER},
      </if>
      <if test="shopId != null">
        #{shopId,jdbcType=INTEGER},
      </if>
      <if test="appid != null">
        #{appid,jdbcType=VARCHAR},
      </if>
      <if test="mchId != null">
        #{mchId,jdbcType=VARCHAR},
      </if>
      <if test="subAppid != null">
        #{subAppid,jdbcType=VARCHAR},
      </if>
      <if test="subMchId != null">
        #{subMchId,jdbcType=VARCHAR},
      </if>
      <if test="secretKey != null">
        #{secretKey,jdbcType=VARCHAR},
      </if>
      <if test="appSecretKey != null">
        #{appSecretKey,jdbcType=VARCHAR},
      </if>
      <if test="privateKey != null">
        #{privateKey,jdbcType=VARCHAR},
      </if>
      <if test="publicKey != null">
        #{publicKey,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        #{payType,jdbcType=VARCHAR},
      </if>
      <if test="imageUrl != null">
        #{imageUrl,jdbcType=VARCHAR},
      </if>
      <if test="version != null">
        #{version,jdbcType=INTEGER},
      </if>
      <if test="isEnable != null">
        #{isEnable,jdbcType=CHAR},
      </if>
      <if test="shopNo != null">
        #{shopNo,jdbcType=VARCHAR},
      </if>
      <if test="priority != null">
        #{priority,jdbcType=TINYINT},
      </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>
      <if test="scanType != null">
        #{scanType,jdbcType=VARCHAR},
      </if>
      <if test="activeStatus != null">
        #{activeStatus,jdbcType=VARCHAR},
      </if>
      <if test="cert != null">
        #{cert,jdbcType=LONGVARBINARY},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannelExample" resultType="java.lang.Integer">
    select count(*) from trade_mch_pay_channel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update trade_mch_pay_channel
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=INTEGER},
      </if>
      <if test="record.shopId != null">
        shop_id = #{record.shopId,jdbcType=INTEGER},
      </if>
      <if test="record.appid != null">
        appid = #{record.appid,jdbcType=VARCHAR},
      </if>
      <if test="record.mchId != null">
        mch_id = #{record.mchId,jdbcType=VARCHAR},
      </if>
      <if test="record.subAppid != null">
        sub_appid = #{record.subAppid,jdbcType=VARCHAR},
      </if>
      <if test="record.subMchId != null">
        sub_mch_id = #{record.subMchId,jdbcType=VARCHAR},
      </if>
      <if test="record.secretKey != null">
        secret_key = #{record.secretKey,jdbcType=VARCHAR},
      </if>
      <if test="record.appSecretKey != null">
        app_secret_key = #{record.appSecretKey,jdbcType=VARCHAR},
      </if>
      <if test="record.privateKey != null">
        private_key = #{record.privateKey,jdbcType=VARCHAR},
      </if>
      <if test="record.publicKey != null">
        public_key = #{record.publicKey,jdbcType=VARCHAR},
      </if>
      <if test="record.payType != null">
        pay_type = #{record.payType,jdbcType=VARCHAR},
      </if>
      <if test="record.imageUrl != null">
        image_url = #{record.imageUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.version != null">
        version = #{record.version,jdbcType=INTEGER},
      </if>
      <if test="record.isEnable != null">
        is_enable = #{record.isEnable,jdbcType=CHAR},
      </if>
      <if test="record.shopNo != null">
        shop_no = #{record.shopNo,jdbcType=VARCHAR},
      </if>
      <if test="record.priority != null">
        priority = #{record.priority,jdbcType=TINYINT},
      </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>
      <if test="record.scanType != null">
        scan_type = #{record.scanType,jdbcType=VARCHAR},
      </if>
      <if test="record.activeStatus != null">
        active_status = #{record.activeStatus,jdbcType=VARCHAR},
      </if>
      <if test="record.cert != null">
        cert = #{record.cert,jdbcType=LONGVARBINARY},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update trade_mch_pay_channel
    set id = #{record.id,jdbcType=INTEGER},
      org_id = #{record.orgId,jdbcType=INTEGER},
      shop_id = #{record.shopId,jdbcType=INTEGER},
      appid = #{record.appid,jdbcType=VARCHAR},
      mch_id = #{record.mchId,jdbcType=VARCHAR},
      sub_appid = #{record.subAppid,jdbcType=VARCHAR},
      sub_mch_id = #{record.subMchId,jdbcType=VARCHAR},
      secret_key = #{record.secretKey,jdbcType=VARCHAR},
      app_secret_key = #{record.appSecretKey,jdbcType=VARCHAR},
      private_key = #{record.privateKey,jdbcType=VARCHAR},
      public_key = #{record.publicKey,jdbcType=VARCHAR},
      pay_type = #{record.payType,jdbcType=VARCHAR},
      image_url = #{record.imageUrl,jdbcType=VARCHAR},
      version = #{record.version,jdbcType=INTEGER},
      is_enable = #{record.isEnable,jdbcType=CHAR},
      shop_no = #{record.shopNo,jdbcType=VARCHAR},
      priority = #{record.priority,jdbcType=TINYINT},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=VARCHAR},
      updated_by = #{record.updatedBy,jdbcType=VARCHAR},
      updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
      scan_type = #{record.scanType,jdbcType=VARCHAR},
      active_status = #{record.activeStatus,jdbcType=VARCHAR},
      cert = #{record.cert,jdbcType=LONGVARBINARY}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update trade_mch_pay_channel
    set id = #{record.id,jdbcType=INTEGER},
      org_id = #{record.orgId,jdbcType=INTEGER},
      shop_id = #{record.shopId,jdbcType=INTEGER},
      appid = #{record.appid,jdbcType=VARCHAR},
      mch_id = #{record.mchId,jdbcType=VARCHAR},
      sub_appid = #{record.subAppid,jdbcType=VARCHAR},
      sub_mch_id = #{record.subMchId,jdbcType=VARCHAR},
      secret_key = #{record.secretKey,jdbcType=VARCHAR},
      app_secret_key = #{record.appSecretKey,jdbcType=VARCHAR},
      private_key = #{record.privateKey,jdbcType=VARCHAR},
      public_key = #{record.publicKey,jdbcType=VARCHAR},
      pay_type = #{record.payType,jdbcType=VARCHAR},
      image_url = #{record.imageUrl,jdbcType=VARCHAR},
      version = #{record.version,jdbcType=INTEGER},
      is_enable = #{record.isEnable,jdbcType=CHAR},
      shop_no = #{record.shopNo,jdbcType=VARCHAR},
      priority = #{record.priority,jdbcType=TINYINT},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=VARCHAR},
      updated_by = #{record.updatedBy,jdbcType=VARCHAR},
      updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
      scan_type = #{record.scanType,jdbcType=VARCHAR},
      active_status = #{record.activeStatus,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannel">
    update trade_mch_pay_channel
    <set>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=INTEGER},
      </if>
      <if test="shopId != null">
        shop_id = #{shopId,jdbcType=INTEGER},
      </if>
      <if test="appid != null">
        appid = #{appid,jdbcType=VARCHAR},
      </if>
      <if test="mchId != null">
        mch_id = #{mchId,jdbcType=VARCHAR},
      </if>
      <if test="subAppid != null">
        sub_appid = #{subAppid,jdbcType=VARCHAR},
      </if>
      <if test="subMchId != null">
        sub_mch_id = #{subMchId,jdbcType=VARCHAR},
      </if>
      <if test="secretKey != null">
        secret_key = #{secretKey,jdbcType=VARCHAR},
      </if>
      <if test="appSecretKey != null">
        app_secret_key = #{appSecretKey,jdbcType=VARCHAR},
      </if>
      <if test="privateKey != null">
        private_key = #{privateKey,jdbcType=VARCHAR},
      </if>
      <if test="publicKey != null">
        public_key = #{publicKey,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        pay_type = #{payType,jdbcType=VARCHAR},
      </if>
      <if test="imageUrl != null">
        image_url = #{imageUrl,jdbcType=VARCHAR},
      </if>
      <if test="version != null">
        version = #{version,jdbcType=INTEGER},
      </if>
      <if test="isEnable != null">
        is_enable = #{isEnable,jdbcType=CHAR},
      </if>
      <if test="shopNo != null">
        shop_no = #{shopNo,jdbcType=VARCHAR},
      </if>
      <if test="priority != null">
        priority = #{priority,jdbcType=TINYINT},
      </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>
      <if test="scanType != null">
        scan_type = #{scanType,jdbcType=VARCHAR},
      </if>
      <if test="activeStatus != null">
        active_status = #{activeStatus,jdbcType=VARCHAR},
      </if>
      <if test="cert != null">
        cert = #{cert,jdbcType=LONGVARBINARY},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannel">
    update trade_mch_pay_channel
    set org_id = #{orgId,jdbcType=INTEGER},
      shop_id = #{shopId,jdbcType=INTEGER},
      appid = #{appid,jdbcType=VARCHAR},
      mch_id = #{mchId,jdbcType=VARCHAR},
      sub_appid = #{subAppid,jdbcType=VARCHAR},
      sub_mch_id = #{subMchId,jdbcType=VARCHAR},
      secret_key = #{secretKey,jdbcType=VARCHAR},
      app_secret_key = #{appSecretKey,jdbcType=VARCHAR},
      private_key = #{privateKey,jdbcType=VARCHAR},
      public_key = #{publicKey,jdbcType=VARCHAR},
      pay_type = #{payType,jdbcType=VARCHAR},
      image_url = #{imageUrl,jdbcType=VARCHAR},
      version = #{version,jdbcType=INTEGER},
      is_enable = #{isEnable,jdbcType=CHAR},
      shop_no = #{shopNo,jdbcType=VARCHAR},
      priority = #{priority,jdbcType=TINYINT},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=VARCHAR},
      updated_by = #{updatedBy,jdbcType=VARCHAR},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      scan_type = #{scanType,jdbcType=VARCHAR},
      active_status = #{activeStatus,jdbcType=VARCHAR},
      cert = #{cert,jdbcType=LONGVARBINARY}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayChannel">
    update trade_mch_pay_channel
    set org_id = #{orgId,jdbcType=INTEGER},
      shop_id = #{shopId,jdbcType=INTEGER},
      appid = #{appid,jdbcType=VARCHAR},
      mch_id = #{mchId,jdbcType=VARCHAR},
      sub_appid = #{subAppid,jdbcType=VARCHAR},
      sub_mch_id = #{subMchId,jdbcType=VARCHAR},
      secret_key = #{secretKey,jdbcType=VARCHAR},
      app_secret_key = #{appSecretKey,jdbcType=VARCHAR},
      private_key = #{privateKey,jdbcType=VARCHAR},
      public_key = #{publicKey,jdbcType=VARCHAR},
      pay_type = #{payType,jdbcType=VARCHAR},
      image_url = #{imageUrl,jdbcType=VARCHAR},
      version = #{version,jdbcType=INTEGER},
      is_enable = #{isEnable,jdbcType=CHAR},
      shop_no = #{shopNo,jdbcType=VARCHAR},
      priority = #{priority,jdbcType=TINYINT},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=VARCHAR},
      updated_by = #{updatedBy,jdbcType=VARCHAR},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      scan_type = #{scanType,jdbcType=VARCHAR},
      active_status = #{activeStatus,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="batchInsert">
    <if test="items.get(0) != null">
            insert into trade_mch_pay_channel  (org_id, shop_id, appid, 
        mch_id, sub_appid, sub_mch_id, 
        secret_key, app_secret_key, private_key, 
        public_key, pay_type, image_url, 
        version, is_enable, shop_no, 
        priority, created_at, created_by, 
        updated_by, updated_at, scan_type, 
        active_status, cert)
      values
      <foreach collection="items" item="item" index="index" separator=",">
      (#{item.orgId,jdbcType=INTEGER}, #{item.shopId,jdbcType=INTEGER}, #{item.appid,jdbcType=VARCHAR}, 
        #{item.mchId,jdbcType=VARCHAR}, #{item.subAppid,jdbcType=VARCHAR}, #{item.subMchId,jdbcType=VARCHAR}, 
        #{item.secretKey,jdbcType=VARCHAR}, #{item.appSecretKey,jdbcType=VARCHAR}, #{item.privateKey,jdbcType=VARCHAR}, 
        #{item.publicKey,jdbcType=VARCHAR}, #{item.payType,jdbcType=VARCHAR}, #{item.imageUrl,jdbcType=VARCHAR}, 
        #{item.version,jdbcType=INTEGER}, #{item.isEnable,jdbcType=CHAR}, #{item.shopNo,jdbcType=VARCHAR}, 
        #{item.priority,jdbcType=TINYINT}, #{item.createdAt,jdbcType=TIMESTAMP}, #{item.createdBy,jdbcType=VARCHAR}, 
        #{item.updatedBy,jdbcType=VARCHAR}, #{item.updatedAt,jdbcType=TIMESTAMP}, #{item.scanType,jdbcType=VARCHAR}, 
        #{item.activeStatus,jdbcType=VARCHAR}, #{item.cert,jdbcType=LONGVARBINARY})
      </foreach>
    </if>
  </insert>
</mapper>