ProductExtMapper.xml 11.6 KB
<?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.yoho.search.dal.ProductExtMapper" >
  <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ProductExt" >
    <id column="product_skn" property="productSkn" jdbcType="INTEGER" />
    <result column="is_hostsell" property="isHostsell" jdbcType="CHAR" />
    <result column="sales_phrase" property="salesPhrase" jdbcType="VARCHAR" />
    <result column="is_new" property="isNew" jdbcType="CHAR" />
    <result column="shelves_day" property="shelvesDay" jdbcType="INTEGER" />
    <result column="sell_channels" property="sellChannels" jdbcType="CHAR" />
    <result column="phrase" property="phrase" jdbcType="VARCHAR" />
    <result column="search_keys" property="searchKeys" jdbcType="VARCHAR" />
    <result column="vedio_url" property="vedioUrl" jdbcType="VARCHAR" />
    <result column="make_crafts" property="makeCrafts" jdbcType="VARCHAR" />
    <result column="brand_series" property="brandSeries" jdbcType="VARCHAR" />
    <result column="brand_model" property="brandModel" jdbcType="VARCHAR" />
    <result column="reject_reason" property="rejectReason" jdbcType="VARCHAR" />
    <result column="deposit" property="deposit" jdbcType="DECIMAL" />
    <result column="buy_time" property="buyTime" jdbcType="INTEGER" />
    <result column="delay_arrival_notice" property="delayArrivalNotice" jdbcType="VARCHAR" />
    <result column="skn_default_img" property="sknDefaultImg" jdbcType="VARCHAR" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.yoho.search.dal.model.ProductExtWithBLOBs" extends="BaseResultMap" >
    <result column="product_desc" property="productDesc" jdbcType="LONGVARCHAR" />
    <result column="recommend" property="recommend" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    product_skn, is_hostsell, sales_phrase, is_new, shelves_day, sell_channels, phrase, 
    search_keys, vedio_url, make_crafts, brand_series, brand_model, reject_reason, deposit, 
    buy_time, delay_arrival_notice, skn_default_img
  </sql>
  <sql id="Blob_Column_List" >
    product_desc, recommend
  </sql>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from product_ext
    where product_skn = #{productSkn,jdbcType=INTEGER}
  </select>
  <select id="selectBySkn" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from product_ext
    where product_skn = #{productSkn,jdbcType=INTEGER}
  </select>
  <select id="selectBySkns" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from product_ext
    where product_skn in 
    <foreach item="item" index="index" collection="skns"
             open="(" separator="," close=")">
      #{item}
    </foreach>
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from product_ext
    where product_skn = #{productSkn,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.yoho.search.dal.model.ProductExtWithBLOBs" >
    insert into product_ext (product_skn, is_hostsell, sales_phrase, 
      is_new, shelves_day, sell_channels, 
      phrase, search_keys, vedio_url, 
      make_crafts, brand_series, brand_model, 
      reject_reason, deposit, buy_time, 
      delay_arrival_notice, skn_default_img, product_desc, 
      recommend)
    values (#{productSkn,jdbcType=INTEGER}, #{isHostsell,jdbcType=CHAR}, #{salesPhrase,jdbcType=VARCHAR}, 
      #{isNew,jdbcType=CHAR}, #{shelvesDay,jdbcType=INTEGER}, #{sellChannels,jdbcType=CHAR}, 
      #{phrase,jdbcType=VARCHAR}, #{searchKeys,jdbcType=VARCHAR}, #{vedioUrl,jdbcType=VARCHAR}, 
      #{makeCrafts,jdbcType=VARCHAR}, #{brandSeries,jdbcType=VARCHAR}, #{brandModel,jdbcType=VARCHAR}, 
      #{rejectReason,jdbcType=VARCHAR}, #{deposit,jdbcType=DECIMAL}, #{buyTime,jdbcType=INTEGER}, 
      #{delayArrivalNotice,jdbcType=VARCHAR}, #{sknDefaultImg,jdbcType=VARCHAR}, #{productDesc,jdbcType=LONGVARCHAR}, 
      #{recommend,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.yoho.search.dal.model.ProductExtWithBLOBs" >
    insert into product_ext
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="productSkn != null" >
        product_skn,
      </if>
      <if test="isHostsell != null" >
        is_hostsell,
      </if>
      <if test="salesPhrase != null" >
        sales_phrase,
      </if>
      <if test="isNew != null" >
        is_new,
      </if>
      <if test="shelvesDay != null" >
        shelves_day,
      </if>
      <if test="sellChannels != null" >
        sell_channels,
      </if>
      <if test="phrase != null" >
        phrase,
      </if>
      <if test="searchKeys != null" >
        search_keys,
      </if>
      <if test="vedioUrl != null" >
        vedio_url,
      </if>
      <if test="makeCrafts != null" >
        make_crafts,
      </if>
      <if test="brandSeries != null" >
        brand_series,
      </if>
      <if test="brandModel != null" >
        brand_model,
      </if>
      <if test="rejectReason != null" >
        reject_reason,
      </if>
      <if test="deposit != null" >
        deposit,
      </if>
      <if test="buyTime != null" >
        buy_time,
      </if>
      <if test="delayArrivalNotice != null" >
        delay_arrival_notice,
      </if>
      <if test="sknDefaultImg != null" >
        skn_default_img,
      </if>
      <if test="productDesc != null" >
        product_desc,
      </if>
      <if test="recommend != null" >
        recommend,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="productSkn != null" >
        #{productSkn,jdbcType=INTEGER},
      </if>
      <if test="isHostsell != null" >
        #{isHostsell,jdbcType=CHAR},
      </if>
      <if test="salesPhrase != null" >
        #{salesPhrase,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null" >
        #{isNew,jdbcType=CHAR},
      </if>
      <if test="shelvesDay != null" >
        #{shelvesDay,jdbcType=INTEGER},
      </if>
      <if test="sellChannels != null" >
        #{sellChannels,jdbcType=CHAR},
      </if>
      <if test="phrase != null" >
        #{phrase,jdbcType=VARCHAR},
      </if>
      <if test="searchKeys != null" >
        #{searchKeys,jdbcType=VARCHAR},
      </if>
      <if test="vedioUrl != null" >
        #{vedioUrl,jdbcType=VARCHAR},
      </if>
      <if test="makeCrafts != null" >
        #{makeCrafts,jdbcType=VARCHAR},
      </if>
      <if test="brandSeries != null" >
        #{brandSeries,jdbcType=VARCHAR},
      </if>
      <if test="brandModel != null" >
        #{brandModel,jdbcType=VARCHAR},
      </if>
      <if test="rejectReason != null" >
        #{rejectReason,jdbcType=VARCHAR},
      </if>
      <if test="deposit != null" >
        #{deposit,jdbcType=DECIMAL},
      </if>
      <if test="buyTime != null" >
        #{buyTime,jdbcType=INTEGER},
      </if>
      <if test="delayArrivalNotice != null" >
        #{delayArrivalNotice,jdbcType=VARCHAR},
      </if>
      <if test="sknDefaultImg != null" >
        #{sknDefaultImg,jdbcType=VARCHAR},
      </if>
      <if test="productDesc != null" >
        #{productDesc,jdbcType=LONGVARCHAR},
      </if>
      <if test="recommend != null" >
        #{recommend,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ProductExtWithBLOBs" >
    update product_ext
    <set >
      <if test="isHostsell != null" >
        is_hostsell = #{isHostsell,jdbcType=CHAR},
      </if>
      <if test="salesPhrase != null" >
        sales_phrase = #{salesPhrase,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null" >
        is_new = #{isNew,jdbcType=CHAR},
      </if>
      <if test="shelvesDay != null" >
        shelves_day = #{shelvesDay,jdbcType=INTEGER},
      </if>
      <if test="sellChannels != null" >
        sell_channels = #{sellChannels,jdbcType=CHAR},
      </if>
      <if test="phrase != null" >
        phrase = #{phrase,jdbcType=VARCHAR},
      </if>
      <if test="searchKeys != null" >
        search_keys = #{searchKeys,jdbcType=VARCHAR},
      </if>
      <if test="vedioUrl != null" >
        vedio_url = #{vedioUrl,jdbcType=VARCHAR},
      </if>
      <if test="makeCrafts != null" >
        make_crafts = #{makeCrafts,jdbcType=VARCHAR},
      </if>
      <if test="brandSeries != null" >
        brand_series = #{brandSeries,jdbcType=VARCHAR},
      </if>
      <if test="brandModel != null" >
        brand_model = #{brandModel,jdbcType=VARCHAR},
      </if>
      <if test="rejectReason != null" >
        reject_reason = #{rejectReason,jdbcType=VARCHAR},
      </if>
      <if test="deposit != null" >
        deposit = #{deposit,jdbcType=DECIMAL},
      </if>
      <if test="buyTime != null" >
        buy_time = #{buyTime,jdbcType=INTEGER},
      </if>
      <if test="delayArrivalNotice != null" >
        delay_arrival_notice = #{delayArrivalNotice,jdbcType=VARCHAR},
      </if>
      <if test="sknDefaultImg != null" >
        skn_default_img = #{sknDefaultImg,jdbcType=VARCHAR},
      </if>
      <if test="productDesc != null" >
        product_desc = #{productDesc,jdbcType=LONGVARCHAR},
      </if>
      <if test="recommend != null" >
        recommend = #{recommend,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where product_skn = #{productSkn,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.yoho.search.dal.model.ProductExtWithBLOBs" >
    update product_ext
    set is_hostsell = #{isHostsell,jdbcType=CHAR},
      sales_phrase = #{salesPhrase,jdbcType=VARCHAR},
      is_new = #{isNew,jdbcType=CHAR},
      shelves_day = #{shelvesDay,jdbcType=INTEGER},
      sell_channels = #{sellChannels,jdbcType=CHAR},
      phrase = #{phrase,jdbcType=VARCHAR},
      search_keys = #{searchKeys,jdbcType=VARCHAR},
      vedio_url = #{vedioUrl,jdbcType=VARCHAR},
      make_crafts = #{makeCrafts,jdbcType=VARCHAR},
      brand_series = #{brandSeries,jdbcType=VARCHAR},
      brand_model = #{brandModel,jdbcType=VARCHAR},
      reject_reason = #{rejectReason,jdbcType=VARCHAR},
      deposit = #{deposit,jdbcType=DECIMAL},
      buy_time = #{buyTime,jdbcType=INTEGER},
      delay_arrival_notice = #{delayArrivalNotice,jdbcType=VARCHAR},
      skn_default_img = #{sknDefaultImg,jdbcType=VARCHAR},
      product_desc = #{productDesc,jdbcType=LONGVARCHAR},
      recommend = #{recommend,jdbcType=LONGVARCHAR}
    where product_skn = #{productSkn,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ProductExt" >
    update product_ext
    set is_hostsell = #{isHostsell,jdbcType=CHAR},
      sales_phrase = #{salesPhrase,jdbcType=VARCHAR},
      is_new = #{isNew,jdbcType=CHAR},
      shelves_day = #{shelvesDay,jdbcType=INTEGER},
      sell_channels = #{sellChannels,jdbcType=CHAR},
      phrase = #{phrase,jdbcType=VARCHAR},
      search_keys = #{searchKeys,jdbcType=VARCHAR},
      vedio_url = #{vedioUrl,jdbcType=VARCHAR},
      make_crafts = #{makeCrafts,jdbcType=VARCHAR},
      brand_series = #{brandSeries,jdbcType=VARCHAR},
      brand_model = #{brandModel,jdbcType=VARCHAR},
      reject_reason = #{rejectReason,jdbcType=VARCHAR},
      deposit = #{deposit,jdbcType=DECIMAL},
      buy_time = #{buyTime,jdbcType=INTEGER},
      delay_arrival_notice = #{delayArrivalNotice,jdbcType=VARCHAR},
      skn_default_img = #{sknDefaultImg,jdbcType=VARCHAR}
    where product_skn = #{productSkn,jdbcType=INTEGER}
  </update>
</mapper>