<?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.TbPlussDeviceStockMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussDeviceStock">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="snNo" jdbcType="VARCHAR" property="snno" />
    <result column="orderNo" jdbcType="VARCHAR" property="orderno" />
    <result column="price" jdbcType="DECIMAL" property="price" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="groupNo" jdbcType="VARCHAR" property="groupno" />
    <result column="buyMercName" jdbcType="VARCHAR" property="buymercname" />
    <result column="buyMercId" jdbcType="VARCHAR" property="buymercid" />
    <result column="actMercName" jdbcType="VARCHAR" property="actmercname" />
    <result column="actMercId" jdbcType="VARCHAR" property="actmercid" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="createBy" jdbcType="VARCHAR" property="createby" />
    <result column="delFlag" jdbcType="VARCHAR" property="delflag" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
    <result column="deviceNo" jdbcType="VARCHAR" property="deviceno" />
    <result column="belongUserId" jdbcType="INTEGER" property="belonguserid" />
    <result column="extractUserId" jdbcType="INTEGER" property="extractuserid" />
    <result column="roleCode" jdbcType="VARCHAR" property="rolecode" />
    <result column="inStockTime" jdbcType="TIMESTAMP" property="instocktime" />
    <result column="transferStatus" jdbcType="VARCHAR" property="transferstatus" />
    <result column="bindTime" jdbcType="TIMESTAMP" property="bindtime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, code, snNo, orderNo, price, type, groupNo, buyMercName, buyMercId, actMercName, 
    actMercId, status, createTime, createBy, delFlag, remarks, updateTime, deviceNo, 
    belongUserId, extractUserId, roleCode, inStockTime, transferStatus, bindTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_device_stock
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_device_stock
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceStock">
    insert into tb_pluss_device_stock (id, code, snNo, 
      orderNo, price, type, 
      groupNo, buyMercName, buyMercId, 
      actMercName, actMercId, status, 
      createTime, createBy, delFlag, 
      remarks, updateTime, deviceNo, 
      belongUserId, extractUserId, roleCode, 
      inStockTime, transferStatus, bindTime
      )
    values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{snno,jdbcType=VARCHAR}, 
      #{orderno,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{type,jdbcType=VARCHAR}, 
      #{groupno,jdbcType=VARCHAR}, #{buymercname,jdbcType=VARCHAR}, #{buymercid,jdbcType=VARCHAR}, 
      #{actmercname,jdbcType=VARCHAR}, #{actmercid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{createby,jdbcType=VARCHAR}, #{delflag,jdbcType=VARCHAR}, 
      #{remarks,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{deviceno,jdbcType=VARCHAR}, 
      #{belonguserid,jdbcType=INTEGER}, #{extractuserid,jdbcType=INTEGER}, #{rolecode,jdbcType=VARCHAR}, 
      #{instocktime,jdbcType=TIMESTAMP}, #{transferstatus,jdbcType=VARCHAR}, #{bindtime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceStock">
    insert into tb_pluss_device_stock
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="snno != null">
        snNo,
      </if>
      <if test="orderno != null">
        orderNo,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="groupno != null">
        groupNo,
      </if>
      <if test="buymercname != null">
        buyMercName,
      </if>
      <if test="buymercid != null">
        buyMercId,
      </if>
      <if test="actmercname != null">
        actMercName,
      </if>
      <if test="actmercid != null">
        actMercId,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="createby != null">
        createBy,
      </if>
      <if test="delflag != null">
        delFlag,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="updatetime != null">
        updateTime,
      </if>
      <if test="deviceno != null">
        deviceNo,
      </if>
      <if test="belonguserid != null">
        belongUserId,
      </if>
      <if test="extractuserid != null">
        extractUserId,
      </if>
      <if test="rolecode != null">
        roleCode,
      </if>
      <if test="instocktime != null">
        inStockTime,
      </if>
      <if test="transferstatus != null">
        transferStatus,
      </if>
      <if test="bindtime != null">
        bindTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="snno != null">
        #{snno,jdbcType=VARCHAR},
      </if>
      <if test="orderno != null">
        #{orderno,jdbcType=VARCHAR},
      </if>
      <if test="price != null">
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="groupno != null">
        #{groupno,jdbcType=VARCHAR},
      </if>
      <if test="buymercname != null">
        #{buymercname,jdbcType=VARCHAR},
      </if>
      <if test="buymercid != null">
        #{buymercid,jdbcType=VARCHAR},
      </if>
      <if test="actmercname != null">
        #{actmercname,jdbcType=VARCHAR},
      </if>
      <if test="actmercid != null">
        #{actmercid,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createby != null">
        #{createby,jdbcType=VARCHAR},
      </if>
      <if test="delflag != null">
        #{delflag,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="updatetime != null">
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="deviceno != null">
        #{deviceno,jdbcType=VARCHAR},
      </if>
      <if test="belonguserid != null">
        #{belonguserid,jdbcType=INTEGER},
      </if>
      <if test="extractuserid != null">
        #{extractuserid,jdbcType=INTEGER},
      </if>
      <if test="rolecode != null">
        #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="instocktime != null">
        #{instocktime,jdbcType=TIMESTAMP},
      </if>
      <if test="transferstatus != null">
        #{transferstatus,jdbcType=VARCHAR},
      </if>
      <if test="bindtime != null">
        #{bindtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceStock">
    update tb_pluss_device_stock
    <set>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="snno != null">
        snNo = #{snno,jdbcType=VARCHAR},
      </if>
      <if test="orderno != null">
        orderNo = #{orderno,jdbcType=VARCHAR},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="groupno != null">
        groupNo = #{groupno,jdbcType=VARCHAR},
      </if>
      <if test="buymercname != null">
        buyMercName = #{buymercname,jdbcType=VARCHAR},
      </if>
      <if test="buymercid != null">
        buyMercId = #{buymercid,jdbcType=VARCHAR},
      </if>
      <if test="actmercname != null">
        actMercName = #{actmercname,jdbcType=VARCHAR},
      </if>
      <if test="actmercid != null">
        actMercId = #{actmercid,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createby != null">
        createBy = #{createby,jdbcType=VARCHAR},
      </if>
      <if test="delflag != null">
        delFlag = #{delflag,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="updatetime != null">
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="deviceno != null">
        deviceNo = #{deviceno,jdbcType=VARCHAR},
      </if>
      <if test="belonguserid != null">
        belongUserId = #{belonguserid,jdbcType=INTEGER},
      </if>
      <if test="extractuserid != null">
        extractUserId = #{extractuserid,jdbcType=INTEGER},
      </if>
      <if test="rolecode != null">
        roleCode = #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="instocktime != null">
        inStockTime = #{instocktime,jdbcType=TIMESTAMP},
      </if>
      <if test="transferstatus != null">
        transferStatus = #{transferstatus,jdbcType=VARCHAR},
      </if>
      <if test="bindtime != null">
        bindTime = #{bindtime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceStock">
    update tb_pluss_device_stock
    set code = #{code,jdbcType=VARCHAR},
      snNo = #{snno,jdbcType=VARCHAR},
      orderNo = #{orderno,jdbcType=VARCHAR},
      price = #{price,jdbcType=DECIMAL},
      type = #{type,jdbcType=VARCHAR},
      groupNo = #{groupno,jdbcType=VARCHAR},
      buyMercName = #{buymercname,jdbcType=VARCHAR},
      buyMercId = #{buymercid,jdbcType=VARCHAR},
      actMercName = #{actmercname,jdbcType=VARCHAR},
      actMercId = #{actmercid,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      createBy = #{createby,jdbcType=VARCHAR},
      delFlag = #{delflag,jdbcType=VARCHAR},
      remarks = #{remarks,jdbcType=VARCHAR},
      updateTime = #{updatetime,jdbcType=TIMESTAMP},
      deviceNo = #{deviceno,jdbcType=VARCHAR},
      belongUserId = #{belonguserid,jdbcType=INTEGER},
      extractUserId = #{extractuserid,jdbcType=INTEGER},
      roleCode = #{rolecode,jdbcType=VARCHAR},
      inStockTime = #{instocktime,jdbcType=TIMESTAMP},
      transferStatus = #{transferstatus,jdbcType=VARCHAR},
      bindTime = #{bindtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>