@ -147,8 +147,8 @@
CASE WHEN WC2.WORK_CENTER != 'NULL' THEN WC2.WORK_CENTER
ELSE WC.WORK_CENTER
END WORK_CENTER,
CASE WHEN WCT.DESCRIPTION != 'NULL' THEN WCT.DESCRIPTION
ELSE WCT2 .DESCRIPTION
CASE WHEN WCT2 .DESCRIPTION != 'NULL' THEN WCT2 .DESCRIPTION
ELSE WCT.DESCRIPTION
END WORK_CENTER_DESCRIPTION,
ZRRT.RESOURCE_NO,R.DESCRIPTION RESOURCE_DESCRIPTION,ZRRT.NC_CODE_NO, /*不良代码描述,维修人员*/
ZRRT.PRELIMINARY_REASON ,dflt.DATA_TAG DEAL_WAY ,ZRRT.DEAL_WAY_DESCRIPTION ,
@ -160,10 +160,10 @@
ZRRT.ACTUAL_START_DATE ACTUAL_START_DATE,ZRRT.ACTUAL_COMPLETE_DATE ACTUAL_COMPLETE_DATE,
'' SHUT_DOWN_TIME,/*暂时无法计算*/
CASE WHEN ZRRT.WAIT_END_DATE IS NOT NULL THEN TO_CHAR(TO_NUMBER((ZRRT.WAIT_END_DATE -ZRRT.WAIT_START_DATE)*24),'FM9999990.000')
ELSE TO_CHAR(TO_NUMBER((SYSDATE-ZRRT.WAIT_START_DATE)*24),'FM9999990.000')
ELSE TO_CHAR(TO_NUMBER((SYSDATE-( ZRRT.WAIT_START_DATE + 8/24) )*24),'FM9999990.000')
END REPAIR_WAIT_TIME,
CASE WHEN ZRRT.ACTUAL_COMPLETE_DATE IS NOT NULL THEN TO_CHAR(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),'FM9999990.000')
ELSE TO_CHAR(TO_NUMBER((SYSDATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),'FM9999990.000')
ELSE TO_CHAR(TO_NUMBER((SYSDATE- 8/24 - ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),'FM9999990.000')
END REPAIR_TIME,
CASE WHEN ZRRT.STATUS = '401' THEN '待维修'
WHEN ZRRT.STATUS = '501' THEN '维修中'
@ -181,7 +181,7 @@
LEFT JOIN WORK_CENTER WC ON WC.HANDLE = WCM.WORK_CENTER_BO AND WC.WC_CATEGORY ='LEVEL2'
LEFT JOIN WORK_CENTER_MEMBER WCM2 ON WCM2.WORK_CENTER_OR_RESOURCE_GBO = WC.HANDLE
LEFT JOIN WORK_CENTER WC2 ON WC2.HANDLE = WCM.WORK_CENTER_BO AND WC2.WC_CATEGORY = 'LEVEL4'
LEFT JOIN WORK_CENTER WC2 ON WC2.HANDLE = WCM2 .WORK_CENTER_BO AND WC2.WC_CATEGORY = 'LEVEL4'
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE AND WCT.LOCALE = #{locale}
LEFT JOIN WORK_CENTER_T WCT2 ON WCT2.WORK_CENTER_BO = WC2.HANDLE AND WCT2.LOCALE = #{locale}
@ -228,7 +228,7 @@
LEFT JOIN Z_NWA_USER ZNU ON ZNU.SITE = ZT.SITE AND ZNU.USER_NAME = ZT.CREATE_USER
WHERE ZT.SITE = #{site}
<if test= "workCenter != null and workCenter != ''" >
AND WC.WORK_CENTER = #{workCenter}
AND ( WC.WORK_CENTER = #{workCenter} OR WT.DESCRIPTION = #{workCenter})
</if>
<if test= "category != null and category != ''" >
AND ZT.CATEGORY = #{category}
@ -325,26 +325,22 @@
LEFT JOIN Z_NWA_USER znu2 ON znu2.USER_NAME = zabd.RESOLVE_USER AND znu2.SITE = zab.SITE
<where >
zab.SITE = #{site} AND zab."TYPE" ='Z'
<if test= " workCenter != null and workCenter != ''">
AND (wc.WORK_CENTER LIKE '%${workCenter}%' OR wct.DESCRIPTION LIKE '%${workCenter}%')
<if test= " abnormalNo != null and abnormalNo != ''">
AND zab.ABNORMAL_NO = #{abnormalNo}
</if>
<if test= " itemNumber != null and itemNumb er != ''">
AND (CASE WHEN itemNumber.VALUE IS NOT NULL THEN itemNumber.VALUE ELSE zab.ITEM_NUMBER END) = #{itemNumb er}
<if test= " shopOrder != null and shopOrd er != ''">
AND so.SHOP_ORDER = #{shopOrd er}
</if>
<if test= "productCategory != null and productCategory != ''" >
AND (dflt.DATA_TAG = #{productCategory} OR
zab.PRODUCT_CATEGORY = #{productCategory}
)
</if>
<if test= "operation != null and operation != ''" >
AND (o.OPERATION LIKE '%${operation}%' OR
ot.DESCRIPTION LIKE '%${operation}%'
)
<if test= "discover != null and discover != ''" >
AND zab.DISCOVER = #{discover}
</if>
<if test= "resrce != null and resrce != ''" >
AND (r2.RESRCE LIKE '%${resrce}%' OR
r2.DESCRIPTION LIKE '%${resrce}%'
)
<if test= "createdUser != null and createdUser != ''" >
AND (zab.CREATED_USER = #{createdUser} OR znu.FULL_NAME = #{createdUser})
</if>
<if test= "startDateTime != null" >
AND zab.CREATED_DATE_TIME > = TO_DATE(#{startDateTime},'YYYY-MM-DD')
@ -472,16 +468,18 @@
SELECT wct.DESCRIPTION WORK_CENTER_DESCRIPTION,cf.VALUE ITEM_NUMBER,
COALESCE(dflt.DATA_TAG,cf2.VALUE) PRODUCT_CATEGORY,
zsd.SHOP_ORDER,it.DESCRIPTION ITEM_DESCRIPTION,zsd.PLANNED_START_DATE,
zsd.PLANNED_COMP_DATE ,zsd.ACTUAL_START_DATE ,ot.DESCRIPTION CURRENT_OPERATION_DESCRIPTION,
zsd.PLANNED_COMP_DATE ,zsd.ACTUAL_START_DATE ,zsd.ACTUAL_COMPLETE_DATE, ot.DESCRIPTION CURRENT_OPERATION_DESCRIPTION,
ot2.DESCRIPTION OPERATION_DESCRIPTION,
CASE WHEN zab.HANDLE IS NOT NULL THEN '是'
ELSE '否'
END IS_ANOMALY,
CASE WHEN zsd.PLANNED_COMP_DATE IS NOT NULL THEN TO_CHAR(TO_NUMBER(zsd.PLANNED_COMP_DATE - SYSDATE),'FM9999990.000')
CASE WHEN zsd.PLANNED_COMP_DATE IS NOT NULL THEN TO_CHAR(TO_NUMBER(zsd.PLANNED_COMP_DATE + 8/24 - SYSDATE),'FM9999990.000')
ELSE ''
END SURPLUS_DAY,
CASE WHEN zsd.ACTUAL_START_DATE IS NOT null AND cf3.VALUE IS NOT null AND cf3.VALUE != 0 AND zsd.ACTUAL_COMPLETE_DATE IS NULL
THEN ROUND(TO_NUMBER(SYSDATE - zsd.ACTUAL_START_DATE)*24/TO_NUMBER(cf3.VALUE),2)*100 || '%'
CASE WHEN zsd.ACTUAL_START_DATE IS NOT NULL AND cf3.VALUE IS NOT NULL AND cf3.VALUE != 0 AND zsd.ACTUAL_COMPLETE_DATE IS NULL
THEN ROUND(TO_NUMBER(SYSDATE - (zsd.ACTUAL_START_DATE+8/24))*24/TO_NUMBER(cf3.VALUE),2)*100 || '%'
WHEN zsd.ACTUAL_START_DATE IS NOT NULL AND cf3.VALUE IS NOT NULL AND cf3.VALUE != 0 AND zsd.ACTUAL_COMPLETE_DATE IS NOT NULL
THEN ROUND(TO_NUMBER((zsd.ACTUAL_COMPLETE_DATE+8/24) - (zsd.ACTUAL_START_DATE+8/24))*24/TO_NUMBER(cf3.VALUE),2)*100 || '%'
ELSE ''
END PROCESS_HOURS
FROM Z_SFC_DISPATCH zsd