|
|
|
@ -833,12 +833,10 @@
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateCallItemStatusByHandle">
|
|
|
|
|
<update id="updateCallItemStatusByCallItem">
|
|
|
|
|
UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime}
|
|
|
|
|
WHERE HANDLE IN
|
|
|
|
|
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
WHERE SITE = #{site} AND STATUS = #{callItem.status} AND SHOP_ORDER = #{callItem.shopOrder}
|
|
|
|
|
AND COMPONENT_BO = #{callItem.componentBo}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateCallItemStatusByCallItemNo">
|
|
|
|
@ -979,15 +977,13 @@
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="findCallItemListPda" resultMap="FullResultMap">
|
|
|
|
|
SELECT MML.*,ZSD.PLANNED_START_DATE FROM
|
|
|
|
|
(
|
|
|
|
|
SELECT ZCI.SITE, CF.VALUE WORK_ORDER, WC.WORK_CENTER, WCT.DESCRIPTION WORK_CENTER_DESCRIPTION,
|
|
|
|
|
ZCI.SHOP_ORDER ,
|
|
|
|
|
IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION,
|
|
|
|
|
CP.ITEM COMPONENT, ITT.DESCRIPTION COMPONENT_DESCRIPTION,
|
|
|
|
|
ZSD.BLANKING_SIZE,
|
|
|
|
|
ZCI.RESRCE, ZCI.CALL_TYPE,
|
|
|
|
|
/*MIN(SO.PLANNED_START_DATE) ,*/
|
|
|
|
|
SELECT MML.* , ZSD.PLANNED_START_DATE FROM
|
|
|
|
|
( SELECT ZCI.SITE, CF.VALUE WORK_ORDER, ZCI.STATUS ,WC.WORK_CENTER, WCT.DESCRIPTION WORK_CENTER_DESCRIPTION,
|
|
|
|
|
ZCI.SHOP_ORDER , ZCI.RESRCE,
|
|
|
|
|
IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION,ZCI.COMPONENT_BO ,
|
|
|
|
|
CP.ITEM COMPONENT, ITT.DESCRIPTION COMPONENT_DESCRIPTION, ZSD.BLANKING_SIZE,
|
|
|
|
|
MIN(ZSD.PLANNED_START_DATE) ,
|
|
|
|
|
/*MIN(SO.PLANNED_START_DATE) , ZCI.CALL_TYPE,*/
|
|
|
|
|
SUM(ZCI.REQUIRED_QTY) REQUIRED_QTY
|
|
|
|
|
FROM Z_CALL_ITEM ZCI
|
|
|
|
|
INNER JOIN Z_SFC_DISPATCH ZSD ON ZSD.HANDLE = ZCI.SFC_DISPATCH_BO
|
|
|
|
@ -1000,19 +996,18 @@
|
|
|
|
|
INNER JOIN ITEM CP ON CP.HANDLE = ZCI.COMPONENT_BO
|
|
|
|
|
INNER JOIN ITEM_T ITT ON ITT.ITEM_BO = CP.HANDLE AND ITT.LOCALE = #{local}
|
|
|
|
|
WHERE ZCI.SITE = #{site}
|
|
|
|
|
GROUP BY ZCI.SITE, CF.VALUE, WC.WORK_CENTER, IM.ITEM, ZSD.BLANKING_SIZE, CP.ITEM, ZCI.RESRCE, ZCI.CALL_TYPE,ZCI.SHOP_ORDER ,
|
|
|
|
|
WCT.DESCRIPTION ,IT.DESCRIPTION , ITT.DESCRIPTION
|
|
|
|
|
ORDER BY CF.VALUE ,ZCI.RESRCE, IM.ITEM ) MML
|
|
|
|
|
INNER JOIN
|
|
|
|
|
( SELECT ZSD.BLANKING_SIZE ,ZSD.RESRCE ,ZSD.WORK_CENTER ,ZSD.SHOP_ORDER ,
|
|
|
|
|
MIN(ZSD.PLANNED_START_DATE) PLANNED_START_DATE
|
|
|
|
|
FROM WIP.Z_SFC_DISPATCH ZSD
|
|
|
|
|
WHERE ZSD.SITE = #{site}
|
|
|
|
|
<if test="user != null and user != ''">AND ZSD.EMPLOYEE LIKE #{user}</if>
|
|
|
|
|
GROUP BY ZSD.WORK_CENTER ,ZSD.BLANKING_SIZE ,ZSD.SHOP_ORDER ,ZSD.RESRCE
|
|
|
|
|
) ZSD
|
|
|
|
|
ON ZSD.SHOP_ORDER = MML.SHOP_ORDER AND ZSD.BLANKING_SIZE = MML.BLANKING_SIZE
|
|
|
|
|
AND ZSD.RESRCE = MML.RESRCE AND ZSD.WORK_CENTER = MML.WORK_CENTER
|
|
|
|
|
<if test="callItem.callType != null and callItem.callType != ''">
|
|
|
|
|
AND ZCI.CALL_TYPE = #{callItem.callType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="user != null and user != ''">
|
|
|
|
|
AND '%' ||#{user} || '%' LIKE ZSD.EMPLOYEE
|
|
|
|
|
</if>
|
|
|
|
|
GROUP BY ZCI.SITE, CF.VALUE, ZCI.STATUS ,WC.WORK_CENTER, IM.ITEM, ZSD.BLANKING_SIZE, CP.ITEM, ZCI.RESRCE, ZCI.CALL_TYPE,ZCI.SHOP_ORDER ,ZCI.COMPONENT_BO ,
|
|
|
|
|
WCT.DESCRIPTION ,IT.DESCRIPTION , ITT.DESCRIPTION ) MML
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
( SELECT MIN(ZSD.PLANNED_START_DATE) PLANNED_START_DATE,SHOP_ORDER FROM Z_SFC_DISPATCH zsd WHERE ZSD.SITE = #{site} GROUP BY ZSD.SHOP_ORDER) ZSD
|
|
|
|
|
ON ZSD.SHOP_ORDER = MML.SHOP_ORDER
|
|
|
|
|
WHERE MML.SITE = #{site}
|
|
|
|
|
<if test="callItem.workCenter != null and callItem.workCenter != ''">
|
|
|
|
|
AND MML.WORK_CENTER = #{callItem.workCenter}
|
|
|
|
|
</if>
|
|
|
|
|