<?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.TbPlussDeviceStockGroupMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussDeviceStockGroup">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="groupCode" jdbcType="VARCHAR" property="groupcode" />
    <result column="groupName" jdbcType="VARCHAR" property="groupname" />
    <result column="desc" jdbcType="VARCHAR" property="desc" />
    <result column="sort" jdbcType="INTEGER" property="sort" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
    <result column="creator" jdbcType="INTEGER" property="creator" />
    <result column="updater" jdbcType="INTEGER" property="updater" />
  </resultMap>
  <sql id="Base_Column_List">
    id, groupCode, groupName, desc, sort, createTime, updateTime, creator, updater
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_device_stock_group
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_device_stock_group
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceStockGroup">
    insert into tb_pluss_device_stock_group (id, groupCode, groupName, 
      desc, sort, createTime, 
      updateTime, creator, updater
      )
    values (#{id,jdbcType=INTEGER}, #{groupcode,jdbcType=VARCHAR}, #{groupname,jdbcType=VARCHAR}, 
      #{desc,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP}, 
      #{updatetime,jdbcType=TIMESTAMP}, #{creator,jdbcType=INTEGER}, #{updater,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceStockGroup">
    insert into tb_pluss_device_stock_group
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="groupcode != null">
        groupCode,
      </if>
      <if test="groupname != null">
        groupName,
      </if>
      <if test="desc != null">
        desc,
      </if>
      <if test="sort != null">
        sort,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="updatetime != null">
        updateTime,
      </if>
      <if test="creator != null">
        creator,
      </if>
      <if test="updater != null">
        updater,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="groupcode != null">
        #{groupcode,jdbcType=VARCHAR},
      </if>
      <if test="groupname != null">
        #{groupname,jdbcType=VARCHAR},
      </if>
      <if test="desc != null">
        #{desc,jdbcType=VARCHAR},
      </if>
      <if test="sort != null">
        #{sort,jdbcType=INTEGER},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="creator != null">
        #{creator,jdbcType=INTEGER},
      </if>
      <if test="updater != null">
        #{updater,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceStockGroup">
    update tb_pluss_device_stock_group
    <set>
      <if test="groupcode != null">
        groupCode = #{groupcode,jdbcType=VARCHAR},
      </if>
      <if test="groupname != null">
        groupName = #{groupname,jdbcType=VARCHAR},
      </if>
      <if test="desc != null">
        desc = #{desc,jdbcType=VARCHAR},
      </if>
      <if test="sort != null">
        sort = #{sort,jdbcType=INTEGER},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="creator != null">
        creator = #{creator,jdbcType=INTEGER},
      </if>
      <if test="updater != null">
        updater = #{updater,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceStockGroup">
    update tb_pluss_device_stock_group
    set groupCode = #{groupcode,jdbcType=VARCHAR},
      groupName = #{groupname,jdbcType=VARCHAR},
      desc = #{desc,jdbcType=VARCHAR},
      sort = #{sort,jdbcType=INTEGER},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP},
      creator = #{creator,jdbcType=INTEGER},
      updater = #{updater,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>