...
|
...
|
@@ -42,13 +42,218 @@ |
|
|
### 对应SQL的操作库表
|
|
|
|
|
|
```xml
|
|
|
<insert id="insert" parameterType="com.yohobuy.platform.dal.product.model.Size" >
|
|
|
insert into size (id, size_name, sort_id,
|
|
|
attribute_id, order_by, create_time,
|
|
|
update_time)
|
|
|
values (#{id,jdbcType=SMALLINT}, #{sizeName,jdbcType=VARCHAR}, #{sortId,jdbcType=SMALLINT},
|
|
|
#{attributeId,jdbcType=VARCHAR}, #{orderBy,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER},
|
|
|
#{updateTime,jdbcType=INTEGER})
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.product.model.BaseProduct" >
|
|
|
update product
|
|
|
<set >
|
|
|
<if test="productName != null" >
|
|
|
product_name = #{productName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="cnAlphabet != null" >
|
|
|
cn_alphabet = #{cnAlphabet,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="brandId != null" >
|
|
|
brand_id = #{brandId,jdbcType=SMALLINT},
|
|
|
</if>
|
|
|
<if test="shopId != null" >
|
|
|
shop_id = #{shopId,jdbcType=SMALLINT},
|
|
|
</if>
|
|
|
<if test="supplierId != null" >
|
|
|
supplier_id = #{supplierId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="isJit != null" >
|
|
|
is_jit = #{isJit,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isScreen != null" >
|
|
|
is_screen = #{isScreen,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isMeasure != null" >
|
|
|
is_measure = #{isMeasure,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="maxSortId != null" >
|
|
|
max_sort_id = #{maxSortId,jdbcType=SMALLINT},
|
|
|
</if>
|
|
|
<if test="middleSortId != null" >
|
|
|
middle_sort_id = #{middleSortId,jdbcType=SMALLINT},
|
|
|
</if>
|
|
|
<if test="smallSortId != null" >
|
|
|
small_sort_id = #{smallSortId,jdbcType=SMALLINT},
|
|
|
</if>
|
|
|
<if test="sortId != null" >
|
|
|
sort_id = #{sortId,jdbcType=SMALLINT},
|
|
|
</if>
|
|
|
<if test="seriesId != null" >
|
|
|
series_id = #{seriesId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="gender != null" >
|
|
|
gender = #{gender,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="style != null" >
|
|
|
style = #{style,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="pattern != null" >
|
|
|
pattern = #{pattern,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="series != null" >
|
|
|
series = #{series,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="models != null" >
|
|
|
models = #{models,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="material != null" >
|
|
|
material = #{material,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="isLimited != null" >
|
|
|
is_limited = #{isLimited,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isSpecial != null" >
|
|
|
is_special = #{isSpecial,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isSales != null" >
|
|
|
is_sales = #{isSales,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isAdvance != null" >
|
|
|
is_advance = #{isAdvance,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isRetrieval != null" >
|
|
|
is_retrieval = #{isRetrieval,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isPromotion != null" >
|
|
|
is_promotion = #{isPromotion,jdbcType=SMALLINT},
|
|
|
</if>
|
|
|
<if test="isOutLets != null" >
|
|
|
is_outlets = #{isOutLets,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isDown != null" >
|
|
|
is_down = #{isDown,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="attribute != null" >
|
|
|
attribute = #{attribute,jdbcType=TINYINT},
|
|
|
</if>
|
|
|
<if test="seasons != null" >
|
|
|
seasons = #{seasons,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="salableTime != null" >
|
|
|
salable_time = #{salableTime,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
edit_time = UNIX_TIMESTAMP(),
|
|
|
<if test="expectArrivalTime != null" >
|
|
|
expect_arrival_time = #{expectArrivalTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="productTag != null" >
|
|
|
product_tag = #{productTag,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="productElements != null" >
|
|
|
product_elements = #{productElements,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="productStyle != null" >
|
|
|
product_style = #{productStyle,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="grade != null" >
|
|
|
grade = #{grade,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="brandFolder != null" >
|
|
|
brand_folder = #{brandFolder,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="limitStartTime != null" >
|
|
|
limit_start_time = #{limitStartTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="limitEndTime != null" >
|
|
|
limit_end_time = #{limitEndTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="expectShelfTime != null" >
|
|
|
expect_shelf_time = #{expectShelfTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="factoryCode != null" >
|
|
|
factory_code = #{factoryCode,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="ageLevel != null" >
|
|
|
age_level = #{ageLevel,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="goodsYears != null" >
|
|
|
goods_years = #{goodsYears,jdbcType=SMALLINT},
|
|
|
</if>
|
|
|
<if test="goodsSeason != null" >
|
|
|
goods_season = #{goodsSeason,jdbcType=SMALLINT},
|
|
|
</if>
|
|
|
<if test="isPromotionalGifts != null" >
|
|
|
is_promotional_gifts = #{isPromotionalGifts,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isLimitbuy != null" >
|
|
|
is_limitbuy = #{isLimitbuy,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="isMeasure != null" >
|
|
|
is_measure = #{isMeasure},
|
|
|
</if>
|
|
|
<if test="isVip != null" >
|
|
|
is_vip = #{isVip,jdbcType=CHAR},
|
|
|
</if>
|
|
|
<if test="editId != null" >
|
|
|
editId = #{editId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="operateInfo != null" >
|
|
|
operate_info = #{operateInfo,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="founder != null" >
|
|
|
founder = #{founder,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</set>
|
|
|
where product_skn = #{productSkn,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
|
|
|
<update id="updateByProductSkn" parameterType="com.yohobuy.platform.dal.shops.model.Product">
|
|
|
update product set erp_product_id = erp_product_id,
|
|
|
<if test="salesPhrase != null" >
|
|
|
sales_phrase = #{salesPhrase,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="phrase != null" >
|
|
|
phrase = #{phrase,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
where erp_product_id= #{erpProductId,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
|
|
|
<update id="updateByProductSkn" parameterType="com.yohobuy.platform.dal.shops.model.Product">
|
|
|
update product set erp_product_id = erp_product_id,
|
|
|
<if test="salesPhrase != null" >
|
|
|
sales_phrase = #{salesPhrase,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="phrase != null" >
|
|
|
phrase = #{phrase,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
where erp_product_id= #{erpProductId,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
<delete id="delBatchBySkn" parameterType="java.lang.Integer" >
|
|
|
delete from product_attribute_property_values
|
|
|
where product_skn = #{productSkn,jdbcType=INTEGER} AND display_position in
|
|
|
<foreach collection="displayPositions" item="item" open="(" close=")" separator=",">
|
|
|
#{item, jdbcType=INTEGER}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
insert into product_attribute_property_values (product_skn, attribute_id,
|
|
|
attribute_value_id, display_position)
|
|
|
values
|
|
|
<foreach collection="doList" item="item" index="index" separator=",">
|
|
|
(#{item.productSkn,jdbcType=INTEGER}, #{item.attributeId,jdbcType=INTEGER},
|
|
|
#{item.attributeValueId,jdbcType=INTEGER}, #{item.displayPosition,jdbcType=INTEGER})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateBrandSeriesBySkn" parameterType="com.yohobuy.platform.dal.product.model.BaseProduct">
|
|
|
update product set series_id = #{seriesId,jdbcType=INTEGER}, brand_folder = #{brandFolder,jdbcType=INTEGER} where product_skn= #{productSkn, jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
<insert id="updateProductOnSaleInfo">
|
|
|
insert into product_ext (product_skn, brand_model, brand_series, make_crafts, sales_phrase, is_hostsell)
|
|
|
values (#{extInfo.productSkn,jdbcType=INTEGER}, #{extInfo.brandModel,jdbcType=VARCHAR}
|
|
|
, #{extInfo.brandSeries,jdbcType=VARCHAR}, #{extInfo.makeCrafts,jdbcType=VARCHAR}
|
|
|
, #{extInfo.salesPhrase,jdbcType=VARCHAR}, #{extInfo.isHostsell,jdbcType=CHAR})
|
|
|
ON DUPLICATE KEY UPDATE brand_model=#{extInfo.brandModel,jdbcType=VARCHAR}, brand_series=#{extInfo.brandSeries,jdbcType=VARCHAR},
|
|
|
make_crafts=#{extInfo.makeCrafts,jdbcType=VARCHAR}, sales_phrase=#{extInfo.salesPhrase,jdbcType=VARCHAR},
|
|
|
is_hostsell=#{extInfo.isHostsell,jdbcType=CHAR}
|
|
|
</insert>
|
|
|
```
|
|
|
|
...
|
...
|
|