<?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.TbPlussMerchantDeviceMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMerchantDevice">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="introDesc" jdbcType="VARCHAR" property="introdesc" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="merchantName" jdbcType="VARCHAR" property="merchantname" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="sn" jdbcType="VARCHAR" property="sn" />
    <result column="venderCode" jdbcType="VARCHAR" property="vendercode" />
    <result column="venderModel" jdbcType="VARCHAR" property="vendermodel" />
    <result column="orderNo" jdbcType="VARCHAR" property="orderno" />
  </resultMap>
  <sql id="Base_Column_List">
    id, name, type, introDesc, status, createDt, merchantCode, merchantName, userId, 
    sn, venderCode, venderModel, orderNo
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merchant_device
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merchant_device
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantDevice">
    insert into tb_pluss_merchant_device (id, name, type, 
      introDesc, status, createDt, 
      merchantCode, merchantName, userId, 
      sn, venderCode, venderModel, 
      orderNo)
    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, 
      #{introdesc,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createdt,jdbcType=TIMESTAMP}, 
      #{merchantcode,jdbcType=VARCHAR}, #{merchantname,jdbcType=VARCHAR}, #{userid,jdbcType=INTEGER}, 
      #{sn,jdbcType=VARCHAR}, #{vendercode,jdbcType=VARCHAR}, #{vendermodel,jdbcType=VARCHAR}, 
      #{orderno,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantDevice">
    insert into tb_pluss_merchant_device
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="introdesc != null">
        introDesc,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="createdt != null">
        createDt,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="merchantname != null">
        merchantName,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="sn != null">
        sn,
      </if>
      <if test="vendercode != null">
        venderCode,
      </if>
      <if test="vendermodel != null">
        venderModel,
      </if>
      <if test="orderno != null">
        orderNo,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="introdesc != null">
        #{introdesc,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="createdt != null">
        #{createdt,jdbcType=TIMESTAMP},
      </if>
      <if test="merchantcode != null">
        #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="sn != null">
        #{sn,jdbcType=VARCHAR},
      </if>
      <if test="vendercode != null">
        #{vendercode,jdbcType=VARCHAR},
      </if>
      <if test="vendermodel != null">
        #{vendermodel,jdbcType=VARCHAR},
      </if>
      <if test="orderno != null">
        #{orderno,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantDevice">
    update tb_pluss_merchant_device
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="introdesc != null">
        introDesc = #{introdesc,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="createdt != null">
        createDt = #{createdt,jdbcType=TIMESTAMP},
      </if>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="merchantname != null">
        merchantName = #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="sn != null">
        sn = #{sn,jdbcType=VARCHAR},
      </if>
      <if test="vendercode != null">
        venderCode = #{vendercode,jdbcType=VARCHAR},
      </if>
      <if test="vendermodel != null">
        venderModel = #{vendermodel,jdbcType=VARCHAR},
      </if>
      <if test="orderno != null">
        orderNo = #{orderno,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantDevice">
    update tb_pluss_merchant_device
    set name = #{name,jdbcType=VARCHAR},
      type = #{type,jdbcType=VARCHAR},
      introDesc = #{introdesc,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      createDt = #{createdt,jdbcType=TIMESTAMP},
      merchantCode = #{merchantcode,jdbcType=VARCHAR},
      merchantName = #{merchantname,jdbcType=VARCHAR},
      userId = #{userid,jdbcType=INTEGER},
      sn = #{sn,jdbcType=VARCHAR},
      venderCode = #{vendercode,jdbcType=VARCHAR},
      venderModel = #{vendermodel,jdbcType=VARCHAR},
      orderNo = #{orderno,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>