|
|
|
@ -42,38 +42,71 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectWmsOdsMateStorageNewsSnList" parameterType="WmsOdsMateStorageNewsSn"
|
|
|
|
|
resultMap="WmsOdsMateStorageNewsSnResult">
|
|
|
|
|
<include refid="selectWmsOdsMateStorageNewsSnVo"/>
|
|
|
|
|
SELECT DISTINCT
|
|
|
|
|
wms_ods_mate_storage_news_sn.mate_order_in_sn_id,
|
|
|
|
|
wms_ods_mate_storage_news_sn.wh_code,
|
|
|
|
|
wms_ods_mate_storage_news_sn.wa_code,
|
|
|
|
|
wms_ods_mate_storage_news_sn.wl_code,
|
|
|
|
|
wms_ods_mate_storage_news_sn.po_line,
|
|
|
|
|
wms_ods_mate_storage_news_sn.material_code,
|
|
|
|
|
wms_ods_mate_storage_news_sn.material_desc,
|
|
|
|
|
wms_ods_mate_storage_news_sn.sn,
|
|
|
|
|
wms_ods_mate_storage_news_sn.bar_code,
|
|
|
|
|
wms_ods_mate_storage_news_sn.amount,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined1,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined2,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined3,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined4,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined5,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined6,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined7,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined8,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined9,
|
|
|
|
|
wms_ods_mate_storage_news_sn.user_defined10,
|
|
|
|
|
wms_ods_mate_storage_news_sn.create_by,
|
|
|
|
|
wms_ods_mate_storage_news_sn.gmt_create,
|
|
|
|
|
wms_ods_mate_storage_news_sn.last_modified_by,
|
|
|
|
|
wms_ods_mate_storage_news_sn.gmt_modified,
|
|
|
|
|
wms_ods_mate_storage_news_sn.active_flag,
|
|
|
|
|
wms_ods_mate_storage_news_sn.factory_code,
|
|
|
|
|
wms_ods_mate_storage_news_sn.sap_factory_code ,
|
|
|
|
|
ods_procure_order.Procure_Code order_no,
|
|
|
|
|
ods_procure_order.User_Defined5 po_no
|
|
|
|
|
FROM
|
|
|
|
|
wms_ods_mate_storage_news_sn
|
|
|
|
|
LEFT JOIN ods_procure_order_card ON ods_procure_order_card.user_defined1= wms_ods_mate_storage_news_sn.wl_code
|
|
|
|
|
LEFT JOIN ods_procure_order ON CAST ( ods_procure_order.ID AS NVARCHAR ) = ods_procure_order_card.User_Defined4
|
|
|
|
|
<where>
|
|
|
|
|
<if test="whCode != null and whCode != ''">and wh_code = #{whCode}</if>
|
|
|
|
|
<if test="waCode != null and waCode != ''">and wa_code = #{waCode}</if>
|
|
|
|
|
<if test="wlCode != null and wlCode != ''">and wl_code = #{wlCode}</if>
|
|
|
|
|
<if test="orderNo != null and orderNo != ''">and order_no = #{orderNo}</if>
|
|
|
|
|
<if test="poNo != null and poNo != ''">and po_no = #{poNo}</if>
|
|
|
|
|
<if test="poLine != null and poLine != ''">and po_line = #{poLine}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and material_code like concat('%', #{materialCode},
|
|
|
|
|
<if test="whCode != null and whCode != ''">and wms_ods_mate_storage_news_sn.wh_code = #{whCode}</if>
|
|
|
|
|
<if test="waCode != null and waCode != ''">and wms_ods_mate_storage_news_sn.wa_code = #{waCode}</if>
|
|
|
|
|
<if test="wlCode != null and wlCode != ''">and wms_ods_mate_storage_news_sn.wl_code = #{wlCode}</if>
|
|
|
|
|
<if test="orderNo != null and orderNo != ''">and ods_procure_order.Procure_Code = #{orderNo}</if>
|
|
|
|
|
<if test="poNo != null and poNo != ''">and ods_procure_order.User_Defined5 = #{poNo}</if>
|
|
|
|
|
<if test="poLine != null and poLine != ''">and wms_ods_mate_storage_news_sn.po_line = #{poLine}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and wms_ods_mate_storage_news_sn.material_code like concat('%', #{materialCode},
|
|
|
|
|
'%') </if>
|
|
|
|
|
<if test="materialDesc != null and materialDesc != ''">and material_desc = #{materialDesc}</if>
|
|
|
|
|
<if test="sn != null and sn != ''">and sn = #{sn}</if>
|
|
|
|
|
<if test="barCode != null and barCode != ''">and bar_code = #{barCode}</if>
|
|
|
|
|
<if test="amount != null ">and amount = #{amount}</if>
|
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''">and user_defined1 = #{userDefined1}</if>
|
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''">and user_defined2 = #{userDefined2}</if>
|
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''">and user_defined3 = #{userDefined3}</if>
|
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''">and user_defined4 = #{userDefined4}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''">and user_defined5 = #{userDefined5}</if>
|
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''">and user_defined6 = #{userDefined6}</if>
|
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''">and user_defined7 = #{userDefined7}</if>
|
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''">and user_defined8 = #{userDefined8}</if>
|
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''">and user_defined9 = #{userDefined9}</if>
|
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''">and user_defined10 = #{userDefined10}</if>
|
|
|
|
|
<if test="gmtCreate != null ">and gmt_create = #{gmtCreate}</if>
|
|
|
|
|
<if test="lastModifiedBy != null and lastModifiedBy != ''">and last_modified_by = #{lastModifiedBy}</if>
|
|
|
|
|
<if test="gmtModified != null ">and gmt_modified = #{gmtModified}</if>
|
|
|
|
|
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="sapFactoryCode != null and sapFactoryCode != ''">and sap_factory_code = #{sapFactoryCode}</if>
|
|
|
|
|
<if test="materialDesc != null and materialDesc != ''">and wms_ods_mate_storage_news_sn.material_desc = #{materialDesc}</if>
|
|
|
|
|
<if test="sn != null and sn != ''">and wms_ods_mate_storage_news_sn.sn = #{sn}</if>
|
|
|
|
|
<if test="barCode != null and barCode != ''">and wms_ods_mate_storage_news_sn.bar_code = #{barCode}</if>
|
|
|
|
|
<if test="amount != null ">and wms_ods_mate_storage_news_sn.amount = #{amount}</if>
|
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''">and wms_ods_mate_storage_news_sn.user_defined1 = #{userDefined1}</if>
|
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''">and wms_ods_mate_storage_news_sn.user_defined2 = #{userDefined2}</if>
|
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''">and wms_ods_mate_storage_news_sn.user_defined3 = #{userDefined3}</if>
|
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''">and wms_ods_mate_storage_news_sn.user_defined4 = #{userDefined4}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''">and wms_ods_mate_storage_news_sn.user_defined5 = #{userDefined5}</if>
|
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''">and wms_ods_mate_storage_news_sn.user_defined6 = #{userDefined6}</if>
|
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''">and wms_ods_mate_storage_news_sn.user_defined7 = #{userDefined7}</if>
|
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''">and wms_ods_mate_storage_news_sn.user_defined8 = #{userDefined8}</if>
|
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''">and wms_ods_mate_storage_news_sn.user_defined9 = #{userDefined9}</if>
|
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''">and wms_ods_mate_storage_news_sn.user_defined10 = #{userDefined10}</if>
|
|
|
|
|
<if test="gmtCreate != null ">and wms_ods_mate_storage_news_sn.gmt_create = #{gmtCreate}</if>
|
|
|
|
|
<if test="lastModifiedBy != null and lastModifiedBy != ''">and wms_ods_mate_storage_news_sn.last_modified_by = #{lastModifiedBy}</if>
|
|
|
|
|
<if test="gmtModified != null ">and wms_ods_mate_storage_news_sn.gmt_modified = #{gmtModified}</if>
|
|
|
|
|
<if test="activeFlag != null and activeFlag != ''">and wms_ods_mate_storage_news_sn.active_flag = #{activeFlag}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''">and wms_ods_mate_storage_news_sn.factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="sapFactoryCode != null and sapFactoryCode != ''">and wms_ods_mate_storage_news_sn.sap_factory_code = #{sapFactoryCode}</if>
|
|
|
|
|
</where>
|
|
|
|
|
ORDER BY gmt_create DESC
|
|
|
|
|
ORDER BY wms_ods_mate_storage_news_sn.gmt_create DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectWmsOdsMateStorageNewsSnByMateOrderInSnId" parameterType="Long"
|
|
|
|
@ -205,6 +238,14 @@
|
|
|
|
|
#{mateOrderInSnId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="cardDy" resultMap="WmsOdsMateStorageNewsSnResult">
|
|
|
|
|
<include refid="selectWmsOdsMateStorageNewsSnVo"/>
|
|
|
|
|
where mate_order_in_sn_id in
|
|
|
|
|
<foreach item="item" collection="list" open="(" separator="," close=")">
|
|
|
|
|
#{item.mateOrderInSnId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateAdd">
|
|
|
|
|
update wms_ods_mate_storage_news
|
|
|
|
|
set amount = ISNULL(amount, 0) + #{amount},
|
|
|
|
|