|
@@ -16,6 +16,7 @@
|
|
|
<result column="specification_" property="specification"/>
|
|
|
<result column="image_" property="image"/>
|
|
|
<result column="stock_count_" property="stockCount"/>
|
|
|
+ <result column="tax_stock_count_" property="taxStockCount"/>
|
|
|
<result column="sell_count_" property="sellCount"/>
|
|
|
<result column="market_price_" property="marketPrice"/>
|
|
|
<result column="discount_price_" property="discountPrice"/>
|
|
@@ -32,6 +33,7 @@
|
|
|
<result column="update_time_" property="updateTime"/>
|
|
|
<result column="complement_goods_id_list_" property="complementGoodsIdList"/>
|
|
|
<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="supply_channel_" property="supplyChannel" />
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -48,23 +50,25 @@
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Goods" useGeneratedKeys="true" keyColumn="id"
|
|
|
keyProperty="id">
|
|
|
INSERT INTO goods
|
|
|
- (goods_category_id_,sn_,name_,brand_,specification_,image_,stock_count_,sell_count_,market_price_,
|
|
|
+ (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_)
|
|
|
- VALUES(#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{sellCount},#{marketPrice},
|
|
|
+ complement_goods_id_list_,update_time_,create_time_,type_,agree_cost_price_,supply_channel_)
|
|
|
+ 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})
|
|
|
+ #{memo},#{publishTime},#{complementGoodsIdList},now(),now(),#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{agreeCostPrice},#{supplyChannel})
|
|
|
</insert>
|
|
|
<insert id="batchInsert">
|
|
|
INSERT INTO goods
|
|
|
(goods_category_id_,name_,brand_,specification_,image_,market_price_,
|
|
|
- discount_price_,group_purchase_price_,desc_,update_time_,create_time_,type_,agree_cost_price_,sn_)
|
|
|
+ discount_price_,group_purchase_price_,desc_,update_time_,create_time_,type_,agree_cost_price_,sn_,
|
|
|
+ stock_count_,tax_stock_count_,supply_channel_)
|
|
|
VALUES
|
|
|
<foreach collection="goodsList" separator="," item="goods">
|
|
|
(#{goods.goodsCategoryId},#{goods.name},#{goods.brand},#{goods.specification},#{goods.image},#{goods.marketPrice},
|
|
|
#{goods.discountPrice},#{goods.groupPurchasePrice},#{goods.desc},now(),now(),
|
|
|
- #{goods.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goods.agreeCostPrice},#{goods.sn})
|
|
|
+ #{goods.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goods.agreeCostPrice},#{goods.sn},
|
|
|
+ #{goods.stockCount},#{goods.taxStockCount},#{goods.supplyChannel})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -137,10 +141,95 @@
|
|
|
<if test="complementGoodsIdList != null">
|
|
|
complement_goods_id_list_ = #{complementGoodsIdList},
|
|
|
</if>
|
|
|
+ <if test="taxStockCount != null">
|
|
|
+ tax_stock_count_ = #{taxStockCount},
|
|
|
+ </if>
|
|
|
+ <if test="supplyChannel != null">
|
|
|
+ supply_channel_ = #{supplyChannel},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
WHERE id_ = #{id}
|
|
|
</update>
|
|
|
|
|
|
+ <update id="batchUpdate" parameterType="com.ym.mec.biz.dal.entity.Goods">
|
|
|
+ <foreach collection="goodsList" item="goods" separator=";">
|
|
|
+ UPDATE goods
|
|
|
+ <set>
|
|
|
+ <if test="goods.agreeCostPrice != null">
|
|
|
+ agree_cost_price_ = #{goods.agreeCostPrice},
|
|
|
+ </if>
|
|
|
+ <if test="goods.specification != null">
|
|
|
+ specification_ = #{goods.specification},
|
|
|
+ </if>
|
|
|
+ <if test="goods.status != null">
|
|
|
+ status_ = #{goods.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="goods.isTop != null">
|
|
|
+ is_top_ = #{goods.isTop,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="goods.type != null">
|
|
|
+ type_ = #{goods.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="goods.sn != null">
|
|
|
+ sn_ = #{goods.sn},
|
|
|
+ </if>
|
|
|
+ <if test="goods.marketPrice != null">
|
|
|
+ market_price_ = #{goods.marketPrice},
|
|
|
+ </if>
|
|
|
+ <if test="goods.memo != null">
|
|
|
+ memo_ = #{goods.memo},
|
|
|
+ </if>
|
|
|
+ <if test="goods.isNew != null">
|
|
|
+ is_new_ = #{goods.isNew,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="goods.groupPurchasePrice != null">
|
|
|
+ group_purchase_price_ = #{goods.groupPurchasePrice},
|
|
|
+ </if>
|
|
|
+ <if test="goods.name != null">
|
|
|
+ name_ = #{goods.name},
|
|
|
+ </if>
|
|
|
+ <if test="goods.stockCount != null">
|
|
|
+ stock_count_ = #{goods.stockCount},
|
|
|
+ </if>
|
|
|
+ <if test="goods.goodsCategoryId != null">
|
|
|
+ goods_category_id_ = #{goods.goodsCategoryId},
|
|
|
+ </if>
|
|
|
+ <if test="goods.brand != null">
|
|
|
+ brand_ = #{goods.brand},
|
|
|
+ </if>
|
|
|
+ <if test="goods.brief != null">
|
|
|
+ brief_ = #{goods.brief},
|
|
|
+ </if>
|
|
|
+ <if test="goods.discountPrice != null">
|
|
|
+ discount_price_ = #{goods.discountPrice},
|
|
|
+ </if>
|
|
|
+ <if test="goods.sellCount != null">
|
|
|
+ sell_count_ = #{goods.sellCount},
|
|
|
+ </if>
|
|
|
+ <if test="goods.image != null">
|
|
|
+ image_ = #{goods.image},
|
|
|
+ </if>
|
|
|
+ <if test="goods.desc != null">
|
|
|
+ desc_ = #{goods.desc},
|
|
|
+ </if>
|
|
|
+ <if test="goods.publishTime != null">
|
|
|
+ publish_time_ = #{goods.publishTime},
|
|
|
+ </if>
|
|
|
+ <if test="goods.complementGoodsIdList != null">
|
|
|
+ complement_goods_id_list_ = #{goods.complementGoodsIdList},
|
|
|
+ </if>
|
|
|
+ <if test="goods.taxStockCount != null">
|
|
|
+ tax_stock_count_ = #{goods.taxStockCount},
|
|
|
+ </if>
|
|
|
+ <if test="goods.supplyChannel != null">
|
|
|
+ supply_channel_ = #{goods.supplyChannel},
|
|
|
+ </if>
|
|
|
+ update_time_ = NOW()
|
|
|
+ </set>
|
|
|
+ WHERE id_ = #{goods.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
<delete id="delete">
|
|
|
DELETE FROM goods WHERE id_ = #{id}
|
|
@@ -202,4 +291,11 @@
|
|
|
#{goodsId}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="findBySns" resultMap="Goods">
|
|
|
+ SELECT * FROM goods WHERE sn_ IN
|
|
|
+ <foreach collection="sns" item="sn" separator="," open="(" close=")">
|
|
|
+ #{sn}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
</mapper>
|