ProductExtMapper.xml 6.81 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="product_desc" property="productDesc" jdbcType="LONGVARCHAR" />
        <result column="recommend" property="recommend" jdbcType="LONGVARCHAR" />
        <result column="is_hostsell" property="isHostsell" jdbcType="CHAR" />
        <result column="shelves_day" property="shelvesDay" jdbcType="INTEGER" />
        <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="advance_begin_time" property="advanceBeginTime" jdbcType="INTEGER" />
        <result column="advance_end_time" property="advanceEndTime" jdbcType="INTEGER" />
        <result column="deposit_multiples" property="depositMultiples" jdbcType="INTEGER" />
        <result column="advance_price" property="advancePrice" jdbcType="DECIMAL" />
        <result column="balance_time" property="balanceTime" jdbcType="INTEGER" />
        <result column="skn_default_img" property="sknDefaultImg" jdbcType="VARCHAR" />
    </resultMap>

    <sql id="Base_Column_List" >
        product_skn, product_desc, recommend, is_hostsell, shelves_day, search_keys, vedio_url,
        make_crafts, brand_series, brand_model, reject_reason, deposit, buy_time, delay_arrival_notice,
        advance_begin_time, advance_end_time, deposit_multiples, advance_price, balance_time,
        skn_default_img
    </sql>

    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
        select
        <include refid="Base_Column_List" />
        from product_ext
        where product_skn = #{productSkn,jdbcType=INTEGER}
        limit 1
    </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.ProductExt" >
        insert into product_ext (product_skn, product_desc, recommend,
        is_hostsell, shelves_day, search_keys,
        vedio_url, make_crafts, brand_series,
        brand_model, reject_reason, deposit,
        buy_time, delay_arrival_notice, advance_begin_time,
        advance_end_time, deposit_multiples, advance_price,
        balance_time, skn_default_img)
        values (#{productSkn,jdbcType=INTEGER}, #{productDesc,jdbcType=VARCHAR}, #{recommend,jdbcType=VARCHAR},
        #{isHostsell,jdbcType=CHAR}, #{shelvesDay,jdbcType=INTEGER}, #{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}, #{advanceBeginTime,jdbcType=INTEGER},
        #{advanceEndTime,jdbcType=INTEGER}, #{depositMultiples,jdbcType=INTEGER}, #{advancePrice,jdbcType=DECIMAL},
        #{balanceTime,jdbcType=INTEGER}, #{sknDefaultImg,jdbcType=VARCHAR})
    </insert>



    <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ProductExt" >
        update product_ext
        <set >
            <if test="productDesc != null" >
                product_desc = #{productDesc,jdbcType=VARCHAR},
            </if>
            <if test="recommend != null" >
                recommend = #{recommend,jdbcType=VARCHAR},
            </if>
            <if test="isHostsell != null" >
                is_hostsell = #{isHostsell,jdbcType=CHAR},
            </if>
            <if test="shelvesDay != null" >
                shelves_day = #{shelvesDay,jdbcType=INTEGER},
            </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="advanceBeginTime != null" >
                advance_begin_time = #{advanceBeginTime,jdbcType=INTEGER},
            </if>
            <if test="advanceEndTime != null" >
                advance_end_time = #{advanceEndTime,jdbcType=INTEGER},
            </if>
            <if test="depositMultiples != null" >
                deposit_multiples = #{depositMultiples,jdbcType=INTEGER},
            </if>
            <if test="advancePrice != null" >
                advance_price = #{advancePrice,jdbcType=DECIMAL},
            </if>
            <if test="balanceTime != null" >
                balance_time = #{balanceTime,jdbcType=INTEGER},
            </if>
            <if test="sknDefaultImg != null" >
                skn_default_img = #{sknDefaultImg,jdbcType=VARCHAR},
            </if>
        </set>
        where product_skn = #{productSkn,jdbcType=INTEGER}
    </update>

    <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>

</mapper>