<?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.TbPlussOfficialGoodsMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoods">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="goodName" jdbcType="VARCHAR" property="goodname" />
    <result column="goodPrice" jdbcType="DECIMAL" property="goodprice" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="toImgUrl" jdbcType="VARCHAR" property="toimgurl" />
    <result column="imgUrl" jdbcType="VARCHAR" property="imgurl" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="isPostage" jdbcType="INTEGER" property="ispostage" />
    <result column="postageFee" jdbcType="DECIMAL" property="postagefee" />
    <result column="deductRule" jdbcType="INTEGER" property="deductrule" />
    <result column="deductValue" jdbcType="DECIMAL" property="deductvalue" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoods">
    <result column="goodDesc" jdbcType="LONGVARCHAR" property="gooddesc" />
  </resultMap>
  <sql id="Base_Column_List">
    id, goodName, goodPrice, status, toImgUrl, imgUrl, createTime, isPostage, postageFee, 
    deductRule, deductValue
  </sql>
  <sql id="Blob_Column_List">
    goodDesc
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from tb_pluss_official_goods
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_official_goods
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoods">
    insert into tb_pluss_official_goods (id, goodName, goodPrice, 
      status, toImgUrl, imgUrl, 
      createTime, isPostage, postageFee, 
      deductRule, deductValue, goodDesc
      )
    values (#{id,jdbcType=INTEGER}, #{goodname,jdbcType=VARCHAR}, #{goodprice,jdbcType=DECIMAL}, 
      #{status,jdbcType=VARCHAR}, #{toimgurl,jdbcType=VARCHAR}, #{imgurl,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{ispostage,jdbcType=INTEGER}, #{postagefee,jdbcType=DECIMAL}, 
      #{deductrule,jdbcType=INTEGER}, #{deductvalue,jdbcType=DECIMAL}, #{gooddesc,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoods">
    insert into tb_pluss_official_goods
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="goodname != null">
        goodName,
      </if>
      <if test="goodprice != null">
        goodPrice,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="toimgurl != null">
        toImgUrl,
      </if>
      <if test="imgurl != null">
        imgUrl,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="ispostage != null">
        isPostage,
      </if>
      <if test="postagefee != null">
        postageFee,
      </if>
      <if test="deductrule != null">
        deductRule,
      </if>
      <if test="deductvalue != null">
        deductValue,
      </if>
      <if test="gooddesc != null">
        goodDesc,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="goodname != null">
        #{goodname,jdbcType=VARCHAR},
      </if>
      <if test="goodprice != null">
        #{goodprice,jdbcType=DECIMAL},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="toimgurl != null">
        #{toimgurl,jdbcType=VARCHAR},
      </if>
      <if test="imgurl != null">
        #{imgurl,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="ispostage != null">
        #{ispostage,jdbcType=INTEGER},
      </if>
      <if test="postagefee != null">
        #{postagefee,jdbcType=DECIMAL},
      </if>
      <if test="deductrule != null">
        #{deductrule,jdbcType=INTEGER},
      </if>
      <if test="deductvalue != null">
        #{deductvalue,jdbcType=DECIMAL},
      </if>
      <if test="gooddesc != null">
        #{gooddesc,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoods">
    update tb_pluss_official_goods
    <set>
      <if test="goodname != null">
        goodName = #{goodname,jdbcType=VARCHAR},
      </if>
      <if test="goodprice != null">
        goodPrice = #{goodprice,jdbcType=DECIMAL},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="toimgurl != null">
        toImgUrl = #{toimgurl,jdbcType=VARCHAR},
      </if>
      <if test="imgurl != null">
        imgUrl = #{imgurl,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="ispostage != null">
        isPostage = #{ispostage,jdbcType=INTEGER},
      </if>
      <if test="postagefee != null">
        postageFee = #{postagefee,jdbcType=DECIMAL},
      </if>
      <if test="deductrule != null">
        deductRule = #{deductrule,jdbcType=INTEGER},
      </if>
      <if test="deductvalue != null">
        deductValue = #{deductvalue,jdbcType=DECIMAL},
      </if>
      <if test="gooddesc != null">
        goodDesc = #{gooddesc,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoods">
    update tb_pluss_official_goods
    set goodName = #{goodname,jdbcType=VARCHAR},
      goodPrice = #{goodprice,jdbcType=DECIMAL},
      status = #{status,jdbcType=VARCHAR},
      toImgUrl = #{toimgurl,jdbcType=VARCHAR},
      imgUrl = #{imgurl,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      isPostage = #{ispostage,jdbcType=INTEGER},
      postageFee = #{postagefee,jdbcType=DECIMAL},
      deductRule = #{deductrule,jdbcType=INTEGER},
      deductValue = #{deductvalue,jdbcType=DECIMAL},
      goodDesc = #{gooddesc,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOfficialGoods">
    update tb_pluss_official_goods
    set goodName = #{goodname,jdbcType=VARCHAR},
      goodPrice = #{goodprice,jdbcType=DECIMAL},
      status = #{status,jdbcType=VARCHAR},
      toImgUrl = #{toimgurl,jdbcType=VARCHAR},
      imgUrl = #{imgurl,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      isPostage = #{ispostage,jdbcType=INTEGER},
      postageFee = #{postagefee,jdbcType=DECIMAL},
      deductRule = #{deductrule,jdbcType=INTEGER},
      deductValue = #{deductvalue,jdbcType=DECIMAL}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>