<?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.TbPlussSubMerchantMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussSubMerchant">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="merchantId" jdbcType="VARCHAR" property="merchantid" />
    <result column="channelId" jdbcType="VARCHAR" property="channelid" />
    <result column="subMchId" jdbcType="VARCHAR" property="submchid" />
    <result column="subMchType" jdbcType="VARCHAR" property="submchtype" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="channelTypeId" jdbcType="INTEGER" property="channeltypeid" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, merchantId, channelId, subMchId, subMchType, remark, channelTypeId, status, createTime, 
    updateTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_sub_merchant
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_sub_merchant
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussSubMerchant">
    insert into tb_pluss_sub_merchant (id, merchantId, channelId, 
      subMchId, subMchType, remark, 
      channelTypeId, status, createTime, 
      updateTime)
    values (#{id,jdbcType=INTEGER}, #{merchantid,jdbcType=VARCHAR}, #{channelid,jdbcType=VARCHAR}, 
      #{submchid,jdbcType=VARCHAR}, #{submchtype,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
      #{channeltypeid,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, 
      #{updatetime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussSubMerchant">
    insert into tb_pluss_sub_merchant
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="merchantid != null">
        merchantId,
      </if>
      <if test="channelid != null">
        channelId,
      </if>
      <if test="submchid != null">
        subMchId,
      </if>
      <if test="submchtype != null">
        subMchType,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="channeltypeid != null">
        channelTypeId,
      </if>
      <if test="status != null">
        status,
      </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="merchantid != null">
        #{merchantid,jdbcType=VARCHAR},
      </if>
      <if test="channelid != null">
        #{channelid,jdbcType=VARCHAR},
      </if>
      <if test="submchid != null">
        #{submchid,jdbcType=VARCHAR},
      </if>
      <if test="submchtype != null">
        #{submchtype,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="channeltypeid != null">
        #{channeltypeid,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        #{status,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.TbPlussSubMerchant">
    update tb_pluss_sub_merchant
    <set>
      <if test="merchantid != null">
        merchantId = #{merchantid,jdbcType=VARCHAR},
      </if>
      <if test="channelid != null">
        channelId = #{channelid,jdbcType=VARCHAR},
      </if>
      <if test="submchid != null">
        subMchId = #{submchid,jdbcType=VARCHAR},
      </if>
      <if test="submchtype != null">
        subMchType = #{submchtype,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="channeltypeid != null">
        channelTypeId = #{channeltypeid,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        status = #{status,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.TbPlussSubMerchant">
    update tb_pluss_sub_merchant
    set merchantId = #{merchantid,jdbcType=VARCHAR},
      channelId = #{channelid,jdbcType=VARCHAR},
      subMchId = #{submchid,jdbcType=VARCHAR},
      subMchType = #{submchtype,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      channelTypeId = #{channeltypeid,jdbcType=INTEGER},
      status = #{status,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>