|
@@ -35,14 +35,19 @@
|
|
|
<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="supply_channel_" property="supplyChannel" />
|
|
|
<result column="stock_type_" property="stockType" 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="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"/>
|
|
|
- <result column="organ_id_list_" property="organIdList"/>
|
|
|
- <result column="organ_name_" property="organName"/>
|
|
|
+ <result column="student_show_organ_id_" property="studentShowOrganId"/>
|
|
|
+ <result column="student_show_organ_name_" property="studentShowOrganName"/>
|
|
|
+ <result column="education_show_organ_id_" property="educationShowOrganId"/>
|
|
|
+ <result column="education_show_organ_name_" property="educationShowOrganName"/>
|
|
|
+ <result column="music_show_organ_id_" property="musicShowOrganId"/>
|
|
|
+ <result column="music_show_organ_name_" property="musicShowOrganName"/>
|
|
|
+ <result column="replacement_show_organ_id_" property="replacementShowOrganId"/>
|
|
|
+ <result column="replacement_show_organ_name_" property="replacementShowOrganName"/>
|
|
|
+ <result column="course_fee_show_organ_id_" property="courseFeeShowOrganId"/>
|
|
|
+ <result column="course_fee_show_organ_name_" property="courseFeeShowOrganName"/>
|
|
|
+ <result column="member_fee_show_organ_id_" property="memberFeeShowOrganId"/>
|
|
|
+ <result column="member_fee_show_organ_name_" property="memberFeeShowOrganName"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -65,40 +70,54 @@
|
|
|
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_,course_view_type_,organ_id_list_)
|
|
|
+ complement_goods_id_list_,update_time_,create_time_,type_,agree_cost_price_,stock_warning_,stock_type_
|
|
|
+ ,student_show_organ_id_,education_show_organ_id_,music_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,member_fee_show_organ_id_)
|
|
|
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},#{courseViewType},#{organIdList})
|
|
|
+ #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{studentShowOrganId},#{educationShowOrganId},#{musicShowOrganId},#{replacementShowOrganId},#{courseFeeShowOrganId},#{memberFeeShowOrganId})
|
|
|
</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_,course_view_type_,organ_id_list_)
|
|
|
+ stock_count_,tax_stock_count_,stock_warning_,stock_type_
|
|
|
+ ,student_show_organ_id_,education_show_organ_id_,music_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,member_fee_show_organ_id_)
|
|
|
VALUES
|
|
|
<foreach collection="list" 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.educationalShow,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.stockCount},#{goods.taxStockCount},
|
|
|
#{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- #{goods.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goods.courseViewType},#{goods.organIdList})
|
|
|
+ #{goods.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{goods.studentShowOrganId},#{goods.educationShowOrganId},#{goods.musicShowOrganId},#{goods.replacementShowOrganId},#{goods.courseFeeShowOrganId},#{goods.memberFeeShowOrganId}
|
|
|
+ )
|
|
|
</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 test="studentShowOrganId != null">
|
|
|
+ student_show_organ_id_ = #{studentShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="educationShowOrganId != null">
|
|
|
+ education_show_organ_id_ = #{educationShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="musicShowOrganId != null">
|
|
|
+ music_show_organ_id_ = #{musicShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="replacementShowOrganId != null">
|
|
|
+ replacement_show_organ_id_ = #{replacementShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="courseFeeShowOrganId != null">
|
|
|
+ course_fee_show_organ_id_ = #{courseFeeShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="memberFeeShowOrganId != null">
|
|
|
+ member_fee_show_organ_id_ = #{memberFeeShowOrganId},
|
|
|
</if>
|
|
|
<if test="agreeCostPrice != null">
|
|
|
agree_cost_price_ = #{agreeCostPrice},
|
|
@@ -166,18 +185,6 @@
|
|
|
<if test="taxStockCount != null">
|
|
|
tax_stock_count_ = #{taxStockCount},
|
|
|
</if>
|
|
|
- <if test="clientShow != null">
|
|
|
- client_show_ = #{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="educationalShow != null">
|
|
|
- educational_show_ = #{educationalShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="musicGroupShow != null">
|
|
|
- music_group_show_ = #{musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="replacementShow != null">
|
|
|
- replacement_show_ = #{replacementShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
<if test="stockWarning != null">
|
|
|
stock_warning_ = #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
@@ -193,8 +200,23 @@
|
|
|
<foreach collection="goodsList" item="goods" separator=";">
|
|
|
UPDATE goods
|
|
|
<set>
|
|
|
- <if test="goods.courseViewType != null">
|
|
|
- course_view_type_ = #{goods.courseViewType},
|
|
|
+ <if test="goods.studentShowOrganId != null">
|
|
|
+ student_show_organ_id_ = #{goods.studentShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="goods.educationShowOrganId != null">
|
|
|
+ education_show_organ_id_ = #{goods.educationShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="goods.musicShowOrganId != null">
|
|
|
+ music_show_organ_id_ = #{goods.musicShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="goods.replacementShowOrganId != null">
|
|
|
+ replacement_show_organ_id_ = #{goods.replacementShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="goods.courseFeeShowOrganId != null">
|
|
|
+ course_fee_show_organ_id_ = #{goods.courseFeeShowOrganId},
|
|
|
+ </if>
|
|
|
+ <if test="goods.memberFeeShowOrganId != null">
|
|
|
+ member_fee_show_organ_id_ = #{goods.memberFeeShowOrganId},
|
|
|
</if>
|
|
|
<if test="goods.agreeCostPrice != null">
|
|
|
agree_cost_price_ = #{goods.agreeCostPrice},
|
|
@@ -262,18 +284,6 @@
|
|
|
<if test="goods.taxStockCount != null">
|
|
|
tax_stock_count_ = #{goods.taxStockCount},
|
|
|
</if>
|
|
|
- <if test="goods.clientShow != null">
|
|
|
- client_show_ = #{goods.clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="goods.educationalShow != null">
|
|
|
- educational_show_ = #{goods.educationalShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="goods.musicGroupShow != null">
|
|
|
- music_group_show_ = #{goods.musicGroupShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="goods.replacementShow != null">
|
|
|
- music_group_show_ = #{goods.replacementShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
<if test="goods.stockWarning != null">
|
|
|
stock_warning_ = #{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
@@ -308,9 +318,6 @@
|
|
|
|
|
|
<sql id="queryGoodsPageSql">
|
|
|
<where>
|
|
|
- <if test="organId != null and organId != ''">
|
|
|
- AND INTE_ARRAY(#{organId},g.organ_id_list_)
|
|
|
- </if>
|
|
|
<if test="goodsCategoryId != null">
|
|
|
AND g.goods_category_id_ = #{goodsCategoryId}
|
|
|
</if>
|
|
@@ -332,20 +339,26 @@
|
|
|
<if test="groupGoods!=null and groupGoods==1">
|
|
|
AND g.complement_goods_id_list_ IS NOT NULL
|
|
|
</if>
|
|
|
- <if test="clientShow!=null">
|
|
|
- AND g.client_show_=#{clientShow}
|
|
|
+ <if test="studentShowOrganId != null and studentShowOrganId != ''">
|
|
|
+ AND FIND_IN_SET(g.student_show_organ_id_,#{studentShowOrganId})
|
|
|
+ </if>
|
|
|
+ <if test="educationShowOrganId != null and educationShowOrganId != ''">
|
|
|
+ AND FIND_IN_SET(g.education_show_organ_id_,#{educationShowOrganId})
|
|
|
</if>
|
|
|
- <if test="educationalShow!=null">
|
|
|
- AND g.educational_show_=#{educationalShow}
|
|
|
+ <if test="musicShowOrganId != null and musicShowOrganId != ''">
|
|
|
+ AND FIND_IN_SET(g.music_show_organ_id_,#{musicShowOrganId})
|
|
|
</if>
|
|
|
- <if test="musicGroupShow!=null">
|
|
|
- AND g.music_group_show_=#{musicGroupShow}
|
|
|
+ <if test="courseFeeShowOrganId != null and courseFeeShowOrganId != ''">
|
|
|
+ AND FIND_IN_SET(g.course_fee_show_organ_id_,#{courseFeeShowOrganId})
|
|
|
</if>
|
|
|
- <if test="courseViewType != null">
|
|
|
- AND FIND_IN_SET(#{courseViewType},g.course_view_type_)
|
|
|
+ <if test="memberFeeShowOrganId!=null and memberFeeShowOrganId != ''">
|
|
|
+ AND FIND_IN_SET(g.member_fee_show_organ_id_,#{memberFeeShowOrganId})
|
|
|
</if>
|
|
|
- <if test="replacementShow!=null">
|
|
|
- AND g.replacement_show_=#{replacementShow}
|
|
|
+ <if test="replacementShowOrganId!=null and replacementShowOrganId != ''">
|
|
|
+ AND FIND_IN_SET(g.replacement_show_organ_id_,#{replacementShowOrganId})
|
|
|
+ </if>
|
|
|
+ <if test="organId != null and organId != ''">
|
|
|
+-- AND FIND_IN_SET(g.replacement_show_organ_id_,#{replacementShowOrganId})
|
|
|
</if>
|
|
|
<if test="search!=null and search!=''">
|
|
|
AND (g.sn_=#{search} OR g.id_=#{search} OR g.name_ LIKE CONCAT('%', #{search}, '%'))
|