<?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.TbPlussDeviceSpecMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussDeviceSpec">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="spec" jdbcType="VARCHAR" property="spec" />
    <result column="specName" jdbcType="VARCHAR" property="specname" />
    <result column="specDesc" jdbcType="VARCHAR" property="specdesc" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <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" />
    <result column="postageFlag" jdbcType="VARCHAR" property="postageflag" />
    <result column="weight" jdbcType="DECIMAL" property="weight" />
  </resultMap>
  <sql id="Base_Column_List">
    id, code, spec, specName, specDesc, type, createTime, updateTime, creator, updater, 
    postageFlag, weight
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_device_spec
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_device_spec
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceSpec">
    insert into tb_pluss_device_spec (id, code, spec, 
      specName, specDesc, type, 
      createTime, updateTime, creator, 
      updater, postageFlag, weight
      )
    values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{spec,jdbcType=VARCHAR}, 
      #{specname,jdbcType=VARCHAR}, #{specdesc,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}, #{creator,jdbcType=INTEGER}, 
      #{updater,jdbcType=INTEGER}, #{postageflag,jdbcType=VARCHAR}, #{weight,jdbcType=DECIMAL}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceSpec">
    insert into tb_pluss_device_spec
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="spec != null">
        spec,
      </if>
      <if test="specname != null">
        specName,
      </if>
      <if test="specdesc != null">
        specDesc,
      </if>
      <if test="type != null">
        type,
      </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>
      <if test="postageflag != null">
        postageFlag,
      </if>
      <if test="weight != null">
        weight,
      </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="spec != null">
        #{spec,jdbcType=VARCHAR},
      </if>
      <if test="specname != null">
        #{specname,jdbcType=VARCHAR},
      </if>
      <if test="specdesc != null">
        #{specdesc,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </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>
      <if test="postageflag != null">
        #{postageflag,jdbcType=VARCHAR},
      </if>
      <if test="weight != null">
        #{weight,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceSpec">
    update tb_pluss_device_spec
    <set>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="spec != null">
        spec = #{spec,jdbcType=VARCHAR},
      </if>
      <if test="specname != null">
        specName = #{specname,jdbcType=VARCHAR},
      </if>
      <if test="specdesc != null">
        specDesc = #{specdesc,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </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>
      <if test="postageflag != null">
        postageFlag = #{postageflag,jdbcType=VARCHAR},
      </if>
      <if test="weight != null">
        weight = #{weight,jdbcType=DECIMAL},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceSpec">
    update tb_pluss_device_spec
    set code = #{code,jdbcType=VARCHAR},
      spec = #{spec,jdbcType=VARCHAR},
      specName = #{specname,jdbcType=VARCHAR},
      specDesc = #{specdesc,jdbcType=VARCHAR},
      type = #{type,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP},
      creator = #{creator,jdbcType=INTEGER},
      updater = #{updater,jdbcType=INTEGER},
      postageFlag = #{postageflag,jdbcType=VARCHAR},
      weight = #{weight,jdbcType=DECIMAL}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>