|
|
|
@ -44,7 +44,8 @@
|
|
|
|
|
ZNU.FULL_NAME OPERATION_USER,ZSD.SFC SFC,
|
|
|
|
|
CASE WHEN S2.STATUS = '405' THEN '是' ELSE '否' END DISPATCH_STATUS,
|
|
|
|
|
ZSD.EARLIEST_START_DATE EARLIEST_START_DATE,ZSD.LATEST_END_DATE LATEST_END_DATE,
|
|
|
|
|
ZSD.ACTUAL_START_DATE ACTUAL_START_DATE,ZSD.ACTUAL_COMPLETE_DATE ACTUAL_COMPLETE_DATE
|
|
|
|
|
ZSD.ACTUAL_START_DATE ACTUAL_START_DATE,ZSD.ACTUAL_COMPLETE_DATE ACTUAL_COMPLETE_DATE,
|
|
|
|
|
CF2.VALUE WORK_ORDER
|
|
|
|
|
FROM SFC S
|
|
|
|
|
INNER JOIN SHOP_ORDER SO ON SO.HANDLE = S.SHOP_ORDER_BO
|
|
|
|
|
INNER JOIN ITEM I ON I.HANDLE = SO.ITEM_BO
|
|
|
|
@ -56,6 +57,7 @@
|
|
|
|
|
SELECT MAX(ZSD2.DISPATCH_SEQ) FROM Z_SFC_DISPATCH ZSD2 WHERE S.SFC = ZSD2.SFC AND S.SITE = ZSD2.SITE
|
|
|
|
|
)
|
|
|
|
|
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = S.SHOP_ORDER_BO AND CF."ATTRIBUTE" = 'ITEM_NUMBER'
|
|
|
|
|
LEFT JOIN CUSTOM_FIELDS CF2 ON CF2.HANDLE = S.SHOP_ORDER_BO AND CF2."ATTRIBUTE" = 'WORK_ORDER'
|
|
|
|
|
INNER JOIN STATUS S2 ON S2.HANDLE = S.STATUS_BO
|
|
|
|
|
<where>
|
|
|
|
|
S.SITE = #{site}
|
|
|
|
@ -72,6 +74,21 @@
|
|
|
|
|
<if test="param.itemDescription != null and param.itemDescription != ''">
|
|
|
|
|
AND IT.DESCRIPTION LIKE '%${param.itemDescription}%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.operation != null and param.operation != ''">
|
|
|
|
|
AND (O.OPERATION LIKE '%${param.operation}%'
|
|
|
|
|
OR OT.DESCRIPTION LIKE '%${param.operation}%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.workOrder != null and param.workOrder != ''">
|
|
|
|
|
AND CF2.VALUE = #{param.workOrder}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.status != null and param.status != ''">
|
|
|
|
|
<if test="param.status == 'Y'.toString()">
|
|
|
|
|
AND S2.STATUS = '405'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.status == 'N'.toString()">
|
|
|
|
|
AND S2.STATUS != '405'
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.startDateTime != null">
|
|
|
|
|
AND ZSD.ACTUAL_START_DATE >= TO_DATE(#{param.startDateTime}, 'YYYY-MM-DD HH24:MI:SS')
|
|
|
|
|
</if>
|
|
|
|
@ -84,6 +101,7 @@
|
|
|
|
|
<if test="param.completeEndDateTime != null">
|
|
|
|
|
AND ZSD.ACTUAL_COMPLETE_DATE <= TO_DATE(#{param.endDateTime}, 'YYYY-MM-DD HH24:MI:SS')
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|