|
@@ -55,24 +55,27 @@
|
|
|
INSERT INTO goods
|
|
|
(goods_category_id_,sn_,name_,brand_,specification_,image_,stock_count_,tax_stock_count_,sell_count_,market_price_,
|
|
|
discount_price_,group_purchase_price_,brief_,desc_,is_new_,is_top_,status_,memo_,publish_time_,
|
|
|
- complement_goods_id_list_,update_time_,create_time_,type_,agree_cost_price_,client_show_,stock_warning_)
|
|
|
+ complement_goods_id_list_,update_time_,create_time_,type_,agree_cost_price_,client_show_,stock_warning_,stock_type_)
|
|
|
VALUES(#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{taxStockCount},#{sellCount},#{marketPrice},
|
|
|
#{discountPrice},#{groupPurchasePrice},#{brief},#{desc},
|
|
|
#{isNew,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isTop,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{memo},#{publishTime},#{complementGoodsIdList},now(),now(),#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{agreeCostPrice},
|
|
|
- #{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
+ #{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
</insert>
|
|
|
<insert id="batchInsert">
|
|
|
INSERT INTO goods
|
|
|
(goods_category_id_,name_,brand_,specification_,image_,market_price_,
|
|
|
discount_price_,group_purchase_price_,brief_,desc_,update_time_,create_time_,type_,agree_cost_price_,sn_,
|
|
|
- stock_count_,tax_stock_count_,client_show_,stock_warning_)
|
|
|
+ stock_count_,tax_stock_count_,client_show_,stock_warning_,stock_type_)
|
|
|
VALUES
|
|
|
<foreach collection="goodsList" separator="," item="goods">
|
|
|
(#{goods.goodsCategoryId},#{goods.name},#{goods.brand},#{goods.specification},#{goods.image},#{goods.marketPrice},
|
|
|
#{goods.discountPrice},#{goods.groupPurchasePrice},#{goods.brief},#{goods.desc},now(),now(),
|
|
|
#{goods.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goods.agreeCostPrice},#{goods.sn},
|
|
|
- #{goods.stockCount},#{goods.taxStockCount},#{goods.clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
+ #{goods.stockCount},#{goods.taxStockCount},#{goods.clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{goods.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -151,6 +154,9 @@
|
|
|
<if test="stockWarning != null">
|
|
|
stock_warning_ = #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
+ <if test="stockType != null">
|
|
|
+ stock_type_ = #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
update_time_ = NOW()
|
|
|
</set>
|
|
|
WHERE id_ = #{id}
|
|
@@ -232,6 +238,9 @@
|
|
|
<if test="goods.stockWarning != null">
|
|
|
stock_warning_ = #{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
+ <if test="goods.stockType != null">
|
|
|
+ stock_type_ = #{goods.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
update_time_ = NOW()
|
|
|
</set>
|
|
|
WHERE id_ = #{goods.id}
|