|
@@ -38,6 +38,7 @@
|
|
<result column="client_show_" property="clientShow" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="client_show_" property="clientShow" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="educational_show_" property="educationalShow" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="educational_show_" property="educationalShow" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="music_group_show_" property="musicGroupShow" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
<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="stock_warning_" property="stockWarning" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
@@ -61,20 +62,20 @@
|
|
INSERT INTO goods
|
|
INSERT INTO goods
|
|
(goods_category_id_,sn_,name_,brand_,specification_,image_,stock_count_,tax_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_,
|
|
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_,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_)
|
|
VALUES(#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{taxStockCount},#{sellCount},#{marketPrice},
|
|
VALUES(#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{taxStockCount},#{sellCount},#{marketPrice},
|
|
#{discountPrice},#{groupPurchasePrice},#{brief},#{desc},
|
|
#{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},
|
|
#{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},
|
|
#{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationalShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
#{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationalShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
- #{musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
|
- #{stockType,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})
|
|
</insert>
|
|
</insert>
|
|
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO goods
|
|
INSERT INTO goods
|
|
(goods_category_id_,name_,brand_,specification_,image_,market_price_,
|
|
(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_,
|
|
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_,stock_warning_,stock_type_)
|
|
|
|
|
|
+ stock_count_,tax_stock_count_,client_show_,educational_show_,music_group_show_,replacement_show_,stock_warning_,stock_type_)
|
|
VALUES
|
|
VALUES
|
|
<foreach collection="list" separator="," item="goods">
|
|
<foreach collection="list" separator="," item="goods">
|
|
(#{goods.goodsCategoryId},#{goods.name},#{goods.brand},#{goods.specification},#{goods.image},#{goods.marketPrice},
|
|
(#{goods.goodsCategoryId},#{goods.name},#{goods.brand},#{goods.specification},#{goods.image},#{goods.marketPrice},
|
|
@@ -83,6 +84,7 @@
|
|
#{goods.stockCount},#{goods.taxStockCount},#{goods.clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
#{goods.stockCount},#{goods.taxStockCount},#{goods.clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
#{goods.educationalShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
#{goods.educationalShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
#{goods.musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
#{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.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})
|
|
</foreach>
|
|
</foreach>
|
|
@@ -166,6 +168,9 @@
|
|
<if test="musicGroupShow != null">
|
|
<if test="musicGroupShow != null">
|
|
music_group_show_ = #{musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
music_group_show_ = #{musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="replacementShow != null">
|
|
|
|
+ replacement_show_ = #{replacementShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
|
+ </if>
|
|
<if test="stockWarning != null">
|
|
<if test="stockWarning != null">
|
|
stock_warning_ = #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
stock_warning_ = #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
</if>
|
|
</if>
|
|
@@ -256,6 +261,9 @@
|
|
<if test="goods.musicGroupShow != null">
|
|
<if test="goods.musicGroupShow != null">
|
|
music_group_show_ = #{goods.musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
music_group_show_ = #{goods.musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="goods.replacementShow != null">
|
|
|
|
+ music_group_show_ = #{goods.replacementShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
|
+ </if>
|
|
<if test="goods.stockWarning != null">
|
|
<if test="goods.stockWarning != null">
|
|
stock_warning_ = #{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
stock_warning_ = #{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
</if>
|
|
</if>
|
|
@@ -319,6 +327,9 @@
|
|
<if test="musicGroupShow!=null">
|
|
<if test="musicGroupShow!=null">
|
|
AND g.music_group_show_=#{musicGroupShow}
|
|
AND g.music_group_show_=#{musicGroupShow}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="replacementShow!=null">
|
|
|
|
+ AND g.replacement_show_=#{replacementShow}
|
|
|
|
+ </if>
|
|
<if test="search!=null and search!=''">
|
|
<if test="search!=null and search!=''">
|
|
AND (g.sn_=#{search} OR g.id_=#{search} OR g.name_ LIKE CONCAT('%', #{search}, '%'))
|
|
AND (g.sn_=#{search} OR g.id_=#{search} OR g.name_ LIKE CONCAT('%', #{search}, '%'))
|
|
</if>
|
|
</if>
|
|
@@ -433,4 +444,39 @@
|
|
<select id="getGoodsByBaseGoodsId" resultMap="Goods">
|
|
<select id="getGoodsByBaseGoodsId" resultMap="Goods">
|
|
SELECT * FROM goods WHERE FIND_IN_SET(#{goodsId}, complement_goods_id_list_)
|
|
SELECT * FROM goods WHERE FIND_IN_SET(#{goodsId}, complement_goods_id_list_)
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <!-- 根据分部获取乐器置换的商品-->
|
|
|
|
+ <select id="getReplacementGoodsPage" resultMap="com.ym.mec.biz.dal.dao.ReplacementInstrumentDao.ReplacementInstrument">
|
|
|
|
+ SELECT g.id_,g.brand_,g.specification_,g.brief_ param_,g.market_price_,g.discount_price_,g.group_purchase_price_ sale_price_,
|
|
|
|
+ (g.discount_price_-g.group_purchase_price_) depreciation_price_
|
|
|
|
+ FROM subject_goods_mapper sgm
|
|
|
|
+ LEFT JOIN goods g ON sgm.goods_category_id_ = g.goods_category_id_
|
|
|
|
+ <include refid="replacementQuerySql"/>
|
|
|
|
+ <include refid="global.limit"/>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getReplacementInstrumentCount" resultType="int">
|
|
|
|
+ SELECT COUNT(*)
|
|
|
|
+ FROM subject_goods_mapper sgm
|
|
|
|
+ LEFT JOIN goods g ON sgm.goods_category_id_ = g.goods_category_id_
|
|
|
|
+ <include refid="replacementQuerySql"/>
|
|
|
|
+ <include refid="global.limit"/>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <sql id="replacementQuerySql">
|
|
|
|
+ <where>
|
|
|
|
+ g.replacement_show_ = 1
|
|
|
|
+ AND g.status_ != 0
|
|
|
|
+ AND g.type_ = 'INSTRUMENT'
|
|
|
|
+ <if test="subjectId != null">
|
|
|
|
+ AND sgm.subject_id_ = #{subjectId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="brand != null and brand!=''">
|
|
|
|
+ AND g.brand_ = #{brand}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="specification != null and specification!=''">
|
|
|
|
+ AND g.specification_ = #{specification}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </sql>
|
|
</mapper>
|
|
</mapper>
|