|
@@ -40,6 +40,7 @@
|
|
|
<result column="music_group_show_" property="musicGroupShow" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="replacement_show_" property="replacementShow" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="stock_warning_" property="stockWarning" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="course_view_type_" property="courseViewType"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -62,20 +63,20 @@
|
|
|
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_,educational_show_,music_group_show_,replacement_show_,stock_warning_,stock_type_)
|
|
|
+ complement_goods_id_list_,update_time_,create_time_,type_,agree_cost_price_,client_show_,educational_show_,music_group_show_,replacement_show_,stock_warning_,stock_type_,course_view_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},#{educationalShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{replacementShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
+ #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{courseViewType})
|
|
|
</insert>
|
|
|
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
|
|
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_,educational_show_,music_group_show_,replacement_show_,stock_warning_,stock_type_)
|
|
|
+ stock_count_,tax_stock_count_,client_show_,educational_show_,music_group_show_,replacement_show_,stock_warning_,stock_type_,course_view_type_)
|
|
|
VALUES
|
|
|
<foreach collection="list" separator="," item="goods">
|
|
|
(#{goods.goodsCategoryId},#{goods.name},#{goods.brand},#{goods.specification},#{goods.image},#{goods.marketPrice},
|
|
@@ -86,13 +87,16 @@
|
|
|
#{goods.musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{goods.replacementShow,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})
|
|
|
+ #{goods.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goods.courseViewType})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.Goods">
|
|
|
UPDATE goods
|
|
|
<set>
|
|
|
+ <if test="courseViewType != null">
|
|
|
+ course_view_type_ = #{courseViewType},
|
|
|
+ </if>
|
|
|
<if test="agreeCostPrice != null">
|
|
|
agree_cost_price_ = #{agreeCostPrice},
|
|
|
</if>
|
|
@@ -186,6 +190,9 @@
|
|
|
<foreach collection="goodsList" item="goods" separator=";">
|
|
|
UPDATE goods
|
|
|
<set>
|
|
|
+ <if test="goods.courseViewType != null">
|
|
|
+ course_view_type_ = #{goods.courseViewType},
|
|
|
+ </if>
|
|
|
<if test="goods.agreeCostPrice != null">
|
|
|
agree_cost_price_ = #{goods.agreeCostPrice},
|
|
|
</if>
|
|
@@ -326,6 +333,9 @@
|
|
|
</if>
|
|
|
<if test="musicGroupShow!=null">
|
|
|
AND g.music_group_show_=#{musicGroupShow}
|
|
|
+ <if test="courseViewType != null">
|
|
|
+ AND FIND_IN_SET(#{courseViewType},g.course_view_type_)
|
|
|
+ </if>
|
|
|
</if>
|
|
|
<if test="replacementShow!=null">
|
|
|
AND g.replacement_show_=#{replacementShow}
|
|
@@ -407,10 +417,13 @@
|
|
|
<select id="getMusicGroupGoodsAndDiscount" resultMap="MusicGroupGoods">
|
|
|
SELECT g.* FROM subject_goods_mapper sgm
|
|
|
LEFT JOIN goods g ON sgm.goods_category_id_ = g.goods_category_id_
|
|
|
- WHERE sgm.subject_id_ = #{subjectId} AND g.music_group_show_=1 AND g.status_ != 0
|
|
|
+ WHERE sgm.subject_id_ = #{subjectId} AND g.music_group_show_ = 1 AND g.status_ != 0
|
|
|
<if test="type!=null">
|
|
|
AND g.type_ = #{type}
|
|
|
</if>
|
|
|
+ <if test="courseViewType != null">
|
|
|
+ AND FIND_IN_SET(g.course_view_type_ = #{courseViewType})
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getMusicGroupGoodsAndDiscountWithSubjects" resultMap="MusicGroupGoods">
|