<?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.TbPlussDeviceGoodsMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussDeviceGoods">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="deviceLogo" jdbcType="VARCHAR" property="devicelogo" />
    <result column="introDesc" jdbcType="VARCHAR" property="introdesc" />
    <result column="sort" jdbcType="INTEGER" property="sort" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="tagId" jdbcType="INTEGER" property="tagid" />
    <result column="depositFlag" jdbcType="VARCHAR" property="depositflag" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.dao.system.entity.TbPlussDeviceGoods">
    <result column="detail" jdbcType="LONGVARCHAR" property="detail" />
  </resultMap>
  <sql id="Base_Column_List">
    id, code, name, deviceLogo, introDesc, sort, status, tagId, depositFlag, createTime, 
    updateTime
  </sql>
  <sql id="Blob_Column_List">
    detail
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from tb_pluss_device_goods
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_device_goods
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceGoods">
    insert into tb_pluss_device_goods (id, code, name, 
      deviceLogo, introDesc, sort, 
      status, tagId, depositFlag, 
      createTime, updateTime, detail
      )
    values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{devicelogo,jdbcType=VARCHAR}, #{introdesc,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, 
      #{status,jdbcType=INTEGER}, #{tagid,jdbcType=INTEGER}, #{depositflag,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}, #{detail,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceGoods">
    insert into tb_pluss_device_goods
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="devicelogo != null">
        deviceLogo,
      </if>
      <if test="introdesc != null">
        introDesc,
      </if>
      <if test="sort != null">
        sort,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="tagid != null">
        tagId,
      </if>
      <if test="depositflag != null">
        depositFlag,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="updatetime != null">
        updateTime,
      </if>
      <if test="detail != null">
        detail,
      </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="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="devicelogo != null">
        #{devicelogo,jdbcType=VARCHAR},
      </if>
      <if test="introdesc != null">
        #{introdesc,jdbcType=VARCHAR},
      </if>
      <if test="sort != null">
        #{sort,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="tagid != null">
        #{tagid,jdbcType=INTEGER},
      </if>
      <if test="depositflag != null">
        #{depositflag,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="detail != null">
        #{detail,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceGoods">
    update tb_pluss_device_goods
    <set>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="devicelogo != null">
        deviceLogo = #{devicelogo,jdbcType=VARCHAR},
      </if>
      <if test="introdesc != null">
        introDesc = #{introdesc,jdbcType=VARCHAR},
      </if>
      <if test="sort != null">
        sort = #{sort,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="tagid != null">
        tagId = #{tagid,jdbcType=INTEGER},
      </if>
      <if test="depositflag != null">
        depositFlag = #{depositflag,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="detail != null">
        detail = #{detail,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceGoods">
    update tb_pluss_device_goods
    set code = #{code,jdbcType=VARCHAR},
      name = #{name,jdbcType=VARCHAR},
      deviceLogo = #{devicelogo,jdbcType=VARCHAR},
      introDesc = #{introdesc,jdbcType=VARCHAR},
      sort = #{sort,jdbcType=INTEGER},
      status = #{status,jdbcType=INTEGER},
      tagId = #{tagid,jdbcType=INTEGER},
      depositFlag = #{depositflag,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP},
      detail = #{detail,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceGoods">
    update tb_pluss_device_goods
    set code = #{code,jdbcType=VARCHAR},
      name = #{name,jdbcType=VARCHAR},
      deviceLogo = #{devicelogo,jdbcType=VARCHAR},
      introDesc = #{introdesc,jdbcType=VARCHAR},
      sort = #{sort,jdbcType=INTEGER},
      status = #{status,jdbcType=INTEGER},
      tagId = #{tagid,jdbcType=INTEGER},
      depositFlag = #{depositflag,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>