<?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.reptileclient.jlifeapp.dao.jz.GoodsProductMapper" >
  <resultMap id="BaseResultMap" type="com.reptileclient.jlifeapp.entity.jz.GoodsProduct" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="goods_id" property="goodsId" jdbcType="INTEGER" />
    <result column="specifications" property="specifications" jdbcType="VARCHAR" />
    <result column="price" property="price" jdbcType="DECIMAL" />
    <result column="number" property="number" jdbcType="INTEGER" />
    <result column="url" property="url" jdbcType="VARCHAR" />
    <result column="add_time" property="addTime" jdbcType="TIMESTAMP" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="deleted" property="deleted" jdbcType="BIT" />
    <result column="sku_id" property="skuId" jdbcType="VARCHAR" />
    <result column="dis_type" property="disType" jdbcType="INTEGER" />
    <result column="dis_percent" property="disPercent" jdbcType="DECIMAL" />
    <result column="dis_amount" property="disAmount" jdbcType="DECIMAL" />
    <result column="goods_sn_whse" property="goodsSnWhse" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, goods_id, specifications, price, number, url, add_time, update_time, deleted, 
    sku_id, dis_type, dis_percent, dis_amount, goods_sn_whse
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from jz_goods_product
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from jz_goods_product
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.reptileclient.jlifeapp.entity.jz.GoodsProduct" >
    insert into jz_goods_product (id, goods_id, specifications, 
      price, number, url, 
      add_time, update_time, deleted, 
      sku_id, dis_type, dis_percent, 
      dis_amount, goods_sn_whse)
    values (#{id,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, #{specifications,jdbcType=VARCHAR}, 
      #{price,jdbcType=DECIMAL}, #{number,jdbcType=INTEGER}, #{url,jdbcType=VARCHAR}, 
      #{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, 
      #{skuId,jdbcType=VARCHAR}, #{disType,jdbcType=INTEGER}, #{disPercent,jdbcType=DECIMAL}, 
      #{disAmount,jdbcType=DECIMAL}, #{goodsSnWhse,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.reptileclient.jlifeapp.entity.jz.GoodsProduct" >
    insert into jz_goods_product
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="goodsId != null" >
        goods_id,
      </if>
      <if test="specifications != null" >
        specifications,
      </if>
      <if test="price != null" >
        price,
      </if>
      <if test="number != null" >
        number,
      </if>
      <if test="url != null" >
        url,
      </if>
      <if test="addTime != null" >
        add_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="deleted != null" >
        deleted,
      </if>
      <if test="skuId != null" >
        sku_id,
      </if>
      <if test="disType != null" >
        dis_type,
      </if>
      <if test="disPercent != null" >
        dis_percent,
      </if>
      <if test="disAmount != null" >
        dis_amount,
      </if>
      <if test="goodsSnWhse != null" >
        goods_sn_whse,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="goodsId != null" >
        #{goodsId,jdbcType=INTEGER},
      </if>
      <if test="specifications != null" >
        #{specifications,jdbcType=VARCHAR},
      </if>
      <if test="price != null" >
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="number != null" >
        #{number,jdbcType=INTEGER},
      </if>
      <if test="url != null" >
        #{url,jdbcType=VARCHAR},
      </if>
      <if test="addTime != null" >
        #{addTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null" >
        #{deleted,jdbcType=BIT},
      </if>
      <if test="skuId != null" >
        #{skuId,jdbcType=VARCHAR},
      </if>
      <if test="disType != null" >
        #{disType,jdbcType=INTEGER},
      </if>
      <if test="disPercent != null" >
        #{disPercent,jdbcType=DECIMAL},
      </if>
      <if test="disAmount != null" >
        #{disAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsSnWhse != null" >
        #{goodsSnWhse,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.reptileclient.jlifeapp.entity.jz.GoodsProduct" >
    update jz_goods_product
    <set >
      <if test="goodsId != null" >
        goods_id = #{goodsId,jdbcType=INTEGER},
      </if>
      <if test="specifications != null" >
        specifications = #{specifications,jdbcType=VARCHAR},
      </if>
      <if test="price != null" >
        price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="number != null" >
        number = #{number,jdbcType=INTEGER},
      </if>
      <if test="url != null" >
        url = #{url,jdbcType=VARCHAR},
      </if>
      <if test="addTime != null" >
        add_time = #{addTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null" >
        deleted = #{deleted,jdbcType=BIT},
      </if>
      <if test="skuId != null" >
        sku_id = #{skuId,jdbcType=VARCHAR},
      </if>
      <if test="disType != null" >
        dis_type = #{disType,jdbcType=INTEGER},
      </if>
      <if test="disPercent != null" >
        dis_percent = #{disPercent,jdbcType=DECIMAL},
      </if>
      <if test="disAmount != null" >
        dis_amount = #{disAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsSnWhse != null" >
        goods_sn_whse = #{goodsSnWhse,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.reptileclient.jlifeapp.entity.jz.GoodsProduct" >
    update jz_goods_product
    set goods_id = #{goodsId,jdbcType=INTEGER},
      specifications = #{specifications,jdbcType=VARCHAR},
      price = #{price,jdbcType=DECIMAL},
      number = #{number,jdbcType=INTEGER},
      url = #{url,jdbcType=VARCHAR},
      add_time = #{addTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      deleted = #{deleted,jdbcType=BIT},
      sku_id = #{skuId,jdbcType=VARCHAR},
      dis_type = #{disType,jdbcType=INTEGER},
      dis_percent = #{disPercent,jdbcType=DECIMAL},
      dis_amount = #{disAmount,jdbcType=DECIMAL},
      goods_sn_whse = #{goodsSnWhse,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>