|
|
<?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.ProductMapper">
|
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.Product">
|
|
|
<id column="id" property="id" jdbcType="INTEGER"/>
|
|
|
<result column="shop_id" property="shopId" jdbcType="INTEGER"/>
|
...
|
...
|
@@ -56,7 +57,9 @@ |
|
|
<result column="is_seckill" property="isSeckill" jdbcType="CHAR"/>
|
|
|
<result column="market_phrase" property="marketPhrase" jdbcType="VARCHAR"/>
|
|
|
<result column="bundle_type" property="bundleType" jdbcType="INTEGER"/>
|
|
|
<result column="coupon_limit_status" property="couponLimitStatus" jdbcType="INTEGER"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
id, erp_product_id,shop_id, product_name, cn_alphabet,
|
|
|
phrase, sales_phrase, brand_id, max_sort_id, middle_sort_id,
|
...
|
...
|
@@ -67,8 +70,9 @@ |
|
|
first_shelve_time,shelve_time,expect_arrival_time, create_time, arrival_time,
|
|
|
edit_time, auditing_time, is_down, status, is_edit,
|
|
|
vip_discount_type, storage,is_outlets,folder_id,sell_channels,
|
|
|
elements, age_level,app_type,is_instalment,is_seckill,is_limitbuy,is_deposit_advance,market_phrase,bundle_type
|
|
|
elements, age_level,app_type,is_instalment,is_seckill,is_limitbuy,is_deposit_advance,market_phrase,bundle_type,coupon_limit_status
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
|
|
parameterType="java.lang.Integer" timeout="20000">
|
|
|
select
|
...
|
...
|
@@ -76,6 +80,7 @@ |
|
|
from product
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectBySkn" resultMap="BaseResultMap"
|
|
|
parameterType="java.lang.Integer" timeout="20000">
|
|
|
select
|
...
|
...
|
@@ -84,11 +89,13 @@ |
|
|
where erp_product_id = #{skn,jdbcType=INTEGER}
|
|
|
limit 1
|
|
|
</select>
|
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"
|
|
|
timeout="20000">
|
|
|
delete from product
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
|
|
|
<insert id="insert" parameterType="com.yoho.search.dal.model.Product"
|
|
|
timeout="20000">
|
|
|
insert ignore into product (id, erp_product_id,shop_id,
|
...
|
...
|
@@ -112,7 +119,7 @@ |
|
|
status, is_edit, vip_discount_type,
|
|
|
storage,
|
|
|
is_outlets, folder_id,
|
|
|
sell_channels, elements,age_level,app_type,is_instalment,is_seckill,is_deposit_advance,is_limitbuy,market_phrase,bundle_type)
|
|
|
sell_channels, elements,age_level,app_type,is_instalment,is_seckill,is_deposit_advance,is_limitbuy,market_phrase,bundle_type,coupon_limit_status)
|
|
|
values
|
|
|
(#{id,jdbcType=INTEGER},
|
|
|
#{erpProductId,jdbcType=INTEGER},
|
...
|
...
|
@@ -154,9 +161,11 @@ |
|
|
#{isDepositAdvance,jdbcType=CHAR},
|
|
|
#{isLimitbuy,jdbcType=CHAR},
|
|
|
#{marketPhrase,jdbcType=VARCHAR},
|
|
|
#{bundleType,jdbcType=INTEGER}
|
|
|
#{bundleType,jdbcType=INTEGER},
|
|
|
#{couponLimitStatus,jdbcType=INTEGER}
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.Product"
|
|
|
timeout="20000">
|
|
|
update product
|
...
|
...
|
@@ -321,34 +330,37 @@ |
|
|
<if test="bundleType != null">
|
|
|
bundle_type = #{bundleType,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="couponLimitStatus != null">
|
|
|
coupon_limit_status = #{couponLimitStatus,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
|
|
|
SELECT count(*) FROM product
|
|
|
</select>
|
|
|
|
|
|
<select id="selectProductIdBySkn" resultType="java.lang.Integer"
|
|
|
parameterType="java.lang.Integer" timeout="20000">
|
|
|
SELECT id FROM product where
|
|
|
erp_product_id =
|
|
|
#{productSkn,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSknByProductId" resultType="java.lang.Integer"
|
|
|
parameterType="java.lang.Integer" timeout="20000">
|
|
|
SELECT erp_product_id FROM product where
|
|
|
id =
|
|
|
#{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|
|
|
from product limit #{offset},#{pageSize}
|
|
|
</select>
|
|
|
<select id="selectAll" resultMap="BaseResultMap" timeout="20000">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|
|
|
from product
|
|
|
</select>
|
|
|
|
|
|
<select id="selectBySkns" resultMap="BaseResultMap">
|
|
|
Select
|
|
|
<include refid="Base_Column_List"/>
|
...
|
...
|
@@ -358,6 +370,7 @@ |
|
|
#{item}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectListByIds" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|
...
|
...
|
@@ -367,4 +380,5 @@ |
|
|
#{item}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|