工作令加工进度表

master
赵嘉伟 3 years ago
parent 64d5fd1af9
commit ad175fc046

@ -845,7 +845,14 @@
ON cf.HANDLE = so.HANDLE AND cf."ATTRIBUTE" = 'ITEM_NUMBER' ON cf.HANDLE = so.HANDLE AND cf."ATTRIBUTE" = 'ITEM_NUMBER'
LEFT JOIN CUSTOM_FIELDS cf2 LEFT JOIN CUSTOM_FIELDS cf2
ON cf2.HANDLE = so.HANDLE AND cf2."ATTRIBUTE" = 'WORK_ORDER' ON cf2.HANDLE = so.HANDLE AND cf2."ATTRIBUTE" = 'WORK_ORDER'
WHERE zsd.SITE = #{site} ) WHERE zsd.SITE = #{site}
<if test="workOrder != null and workOrder != ''">
AND cf2.VALUE = #{workOrder}
</if>
<if test="itemNumber != null and itemNumber != ''">
AND cf.VALUE = #{itemNumber}
</if>
)
GROUP BY SITE,WORK_ORDER, ITEM_NUMBER,WORK_CENTER GROUP BY SITE,WORK_ORDER, ITEM_NUMBER,WORK_CENTER
) zsd ) zsd
LEFT JOIN ( LEFT JOIN (
@ -854,8 +861,15 @@
LEFT JOIN SHOP_ORDER so ON so.SHOP_ORDER = zsd.SHOP_ORDER AND so.SITE = zsd.SITE LEFT JOIN SHOP_ORDER so ON so.SHOP_ORDER = zsd.SHOP_ORDER AND so.SITE = zsd.SITE
LEFT JOIN CUSTOM_FIELDS cf ON cf.HANDLE = so.HANDLE AND cf."ATTRIBUTE" = 'ITEM_NUMBER' LEFT JOIN CUSTOM_FIELDS cf ON cf.HANDLE = so.HANDLE AND cf."ATTRIBUTE" = 'ITEM_NUMBER'
LEFT JOIN CUSTOM_FIELDS cf2 ON cf2.HANDLE = so.HANDLE AND cf2."ATTRIBUTE" = 'WORK_ORDER' LEFT JOIN CUSTOM_FIELDS cf2 ON cf2.HANDLE = so.HANDLE AND cf2."ATTRIBUTE" = 'WORK_ORDER'
WHERE zsd.DISPATCH_STATUS != 'COMPLETE' AND zsd.DISPATCH_STATUS != 'CANCEL' AND zsd.SITE= #{site} GROUP BY cf2.VALUE, cf.VALUE,zsd.WORK_CENTER WHERE zsd.DISPATCH_STATUS != 'COMPLETE' AND zsd.DISPATCH_STATUS != 'CANCEL' AND zsd.SITE= #{site}
) zsd2 ON zsd2.WORK_ORDER || zsd2.ITEM_NUMBER = zsd.WORK_ORDER || zsd.ITEM_NUMBER AND zsd2.WORK_CENTER = zsd.WORK_CENTER <if test="workOrder != null and workOrder != ''">
AND cf2.VALUE = #{workOrder}
</if>
<if test="itemNumber != null and itemNumber != ''">
AND cf.VALUE = #{itemNumber}
</if>
GROUP BY cf2.VALUE, cf.VALUE,zsd.WORK_CENTER
) zsd2 ON zsd2.WORK_CENTER = zsd.WORK_CENTER AND zsd2.WORK_ORDER || zsd2.ITEM_NUMBER = zsd.WORK_ORDER || zsd.ITEM_NUMBER
LEFT JOIN ( LEFT JOIN (
SELECT cf2.VALUE WORK_ORDER, cf.VALUE ITEM_NUMBER, COUNT(zsd.HANDLE) QTY,zsd.WORK_CENTER SELECT cf2.VALUE WORK_ORDER, cf.VALUE ITEM_NUMBER, COUNT(zsd.HANDLE) QTY,zsd.WORK_CENTER
FROM Z_SFC_DISPATCH zsd FROM Z_SFC_DISPATCH zsd
@ -863,8 +877,14 @@
LEFT JOIN CUSTOM_FIELDS cf ON cf.HANDLE = so.HANDLE AND cf."ATTRIBUTE" = 'ITEM_NUMBER' LEFT JOIN CUSTOM_FIELDS cf ON cf.HANDLE = so.HANDLE AND cf."ATTRIBUTE" = 'ITEM_NUMBER'
LEFT JOIN CUSTOM_FIELDS cf2 ON cf2.HANDLE = so.HANDLE AND cf2."ATTRIBUTE" = 'WORK_ORDER' LEFT JOIN CUSTOM_FIELDS cf2 ON cf2.HANDLE = so.HANDLE AND cf2."ATTRIBUTE" = 'WORK_ORDER'
WHERE zsd.SITE = #{site} WHERE zsd.SITE = #{site}
<if test="workOrder != null and workOrder != ''">
AND cf2.VALUE = #{workOrder}
</if>
<if test="itemNumber != null and itemNumber != ''">
AND cf.VALUE = #{itemNumber}
</if>
GROUP BY cf2.VALUE, cf.VALUE,zsd.WORK_CENTER GROUP BY cf2.VALUE, cf.VALUE,zsd.WORK_CENTER
) zsd3 ON zsd3.WORK_ORDER || zsd3.ITEM_NUMBER = zsd.WORK_ORDER || zsd.ITEM_NUMBER AND zsd3.WORK_CENTER = zsd.WORK_CENTER AND zsd3.WORK_CENTER = zsd.WORK_CENTER ) zsd3 ON zsd3.WORK_CENTER = zsd.WORK_CENTER AND zsd3.WORK_ORDER || zsd3.ITEM_NUMBER = zsd.WORK_ORDER || zsd.ITEM_NUMBER
INNER JOIN WORK_CENTER wc ON wc.WORK_CENTER = zsd.WORK_CENTER AND wc.SITE = zsd.SITE INNER JOIN WORK_CENTER wc ON wc.WORK_CENTER = zsd.WORK_CENTER AND wc.SITE = zsd.SITE
LEFT JOIN WORK_CENTER_T wct ON wct.WORK_CENTER_BO = wc.HANDLE AND wct.LOCALE = 'zh' LEFT JOIN WORK_CENTER_T wct ON wct.WORK_CENTER_BO = wc.HANDLE AND wct.LOCALE = 'zh'
WHERE (zsd.WORK_ORDER IS NOT NULL OR zsd.ITEM_NUMBER IS NOT NULL) WHERE (zsd.WORK_ORDER IS NOT NULL OR zsd.ITEM_NUMBER IS NOT NULL)
@ -874,12 +894,6 @@
<if test="workCenter != null and workCenter != ''"> <if test="workCenter != null and workCenter != ''">
AND (WORK_CENTER = #{workCenter} OR WORK_CENTER_DESCRIPTION = #{workCenter}) AND (WORK_CENTER = #{workCenter} OR WORK_CENTER_DESCRIPTION = #{workCenter})
</if> </if>
<if test="workOrder != null and workOrder != ''">
AND WORK_ORDER = #{workOrder}
</if>
<if test="itemNumber != null and itemNumber != ''">
AND ITEM_NUMBER = #{itemNumber}
</if>
<if test="isCompleted != null and isCompleted != ''"> <if test="isCompleted != null and isCompleted != ''">
AND IS_COMPLETE = #{isCompleted} AND IS_COMPLETE = #{isCompleted}
</if> </if>
@ -889,7 +903,6 @@
<if test="endDateTime != null and endDateTime != ''"> <if test="endDateTime != null and endDateTime != ''">
AND CREATED_DATE_TIME &lt;= TO_DATE(#{endDateTime}|| '15:59:59','YYYY-MM-DD HH24:MI:SS') AND CREATED_DATE_TIME &lt;= TO_DATE(#{endDateTime}|| '15:59:59','YYYY-MM-DD HH24:MI:SS')
</if> </if>
</where> </where>
ORDER BY CREATED_DATE_TIME ASC ORDER BY CREATED_DATE_TIME ASC
</select> </select>

Loading…
Cancel
Save