<?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.TbPlussSubMerchantApplyOrderMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussSubMerchantApplyOrder">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="channelId" jdbcType="INTEGER" property="channelid" />
    <result column="subMchType" jdbcType="VARCHAR" property="submchtype" />
    <result column="applyNo" jdbcType="VARCHAR" property="applyno" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="infoQrcode" jdbcType="VARCHAR" property="infoqrcode" />
    <result column="resultStatus" jdbcType="VARCHAR" property="resultstatus" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, merchantCode, channelId, subMchType, applyNo, status, infoQrcode, resultStatus, 
    remark, createTime, updateTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_sub_merchant_apply_order
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_sub_merchant_apply_order
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussSubMerchantApplyOrder">
    insert into tb_pluss_sub_merchant_apply_order (id, merchantCode, channelId, 
      subMchType, applyNo, status, 
      infoQrcode, resultStatus, remark, 
      createTime, updateTime)
    values (#{id,jdbcType=INTEGER}, #{merchantcode,jdbcType=VARCHAR}, #{channelid,jdbcType=INTEGER}, 
      #{submchtype,jdbcType=VARCHAR}, #{applyno,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, 
      #{infoqrcode,jdbcType=VARCHAR}, #{resultstatus,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussSubMerchantApplyOrder">
    insert into tb_pluss_sub_merchant_apply_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="channelid != null">
        channelId,
      </if>
      <if test="submchtype != null">
        subMchType,
      </if>
      <if test="applyno != null">
        applyNo,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="infoqrcode != null">
        infoQrcode,
      </if>
      <if test="resultstatus != null">
        resultStatus,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="updatetime != null">
        updateTime,
      </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="channelid != null">
        #{channelid,jdbcType=INTEGER},
      </if>
      <if test="submchtype != null">
        #{submchtype,jdbcType=VARCHAR},
      </if>
      <if test="applyno != null">
        #{applyno,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="infoqrcode != null">
        #{infoqrcode,jdbcType=VARCHAR},
      </if>
      <if test="resultstatus != null">
        #{resultstatus,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussSubMerchantApplyOrder">
    update tb_pluss_sub_merchant_apply_order
    <set>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="channelid != null">
        channelId = #{channelid,jdbcType=INTEGER},
      </if>
      <if test="submchtype != null">
        subMchType = #{submchtype,jdbcType=VARCHAR},
      </if>
      <if test="applyno != null">
        applyNo = #{applyno,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="infoqrcode != null">
        infoQrcode = #{infoqrcode,jdbcType=VARCHAR},
      </if>
      <if test="resultstatus != null">
        resultStatus = #{resultstatus,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussSubMerchantApplyOrder">
    update tb_pluss_sub_merchant_apply_order
    set merchantCode = #{merchantcode,jdbcType=VARCHAR},
      channelId = #{channelid,jdbcType=INTEGER},
      subMchType = #{submchtype,jdbcType=VARCHAR},
      applyNo = #{applyno,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      infoQrcode = #{infoqrcode,jdbcType=VARCHAR},
      resultStatus = #{resultstatus,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>