|
|
|
@ -144,8 +144,15 @@
|
|
|
|
|
TRUNC(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.ACTUAL_START_DATE)*24),2) SHUT_DOWN_TIME,
|
|
|
|
|
TRUNC(TO_NUMBER((ZRRT.WAIT_END_DATE -ZRRT.WAIT_START_DATE)*24),2) REPAIR_WAIT_TIME,
|
|
|
|
|
TRUNC(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.ACTUAL_START_DATE-ZRRT.WAIT_TIME)*24),2) REPAIR_TIME,
|
|
|
|
|
ZRRT. STATUS ,ZRRT.REPORT_USER REPORT_USER,ZNU.FULL_NAME REPORT_USER_DESCRIPTION,
|
|
|
|
|
ZRRT.REPAIR_USERS ,ZRRT.REMARK
|
|
|
|
|
CASE WHEN ZRRT.STATUS = '401' THEN '待维修'
|
|
|
|
|
WHEN ZRRT.STATUS = '501' THEN '维修中'
|
|
|
|
|
WHEN ZRRT.STATUS = '502' THEN '维修等待'
|
|
|
|
|
WHEN ZRRT.STATUS = '302' THEN '关闭'
|
|
|
|
|
WHEN ZRRT.STATUS = '301' THEN '维修完成'
|
|
|
|
|
WHEN ZRRT.STATUS = '601' THEN '报修单确认'
|
|
|
|
|
END STATUS
|
|
|
|
|
,ZRRT.REPORT_USER REPORT_USER,ZNU.FULL_NAME REPORT_USER_DESCRIPTION,
|
|
|
|
|
ZRRT.REPAIR_USERS ,ZRRT.REMARK
|
|
|
|
|
FROM
|
|
|
|
|
Z_RESOURCE_REPAIR_TASK ZRRT
|
|
|
|
|
INNER JOIN RESRCE R ON R.RESRCE = ZRRT.RESOURCE_NO AND R.SITE = ZRRT.SITE
|
|
|
|
@ -325,4 +332,57 @@
|
|
|
|
|
rt.DESCRIPTION, dflt.DATA_TAG,zabd.DUTY_CAUSE_TYPE,zabd.DUTY_TYPE ,zabd.DUTY_DEPART
|
|
|
|
|
ORDER BY zab.CREATED_DATE_TIME DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="findAbnormalRecord" parameterType="java.util.HashMap" resultType="java.util.HashMap">
|
|
|
|
|
SELECT wc.WORK_CENTER ,zab.PRODUCT_CATEGORY ,cf.VALUE WORK_ORDER,so.SHOP_ORDER SHOP_ORDER ,
|
|
|
|
|
i.ITEM ITEM,it.DESCRIPTION ITEM_DESCRIPTION,zab.SFC SFC,zab.ABNORMAL_NO ABNORMAL_NO,
|
|
|
|
|
CASE WHEN zab."TYPE" = 'Z' THEN '质量异常'
|
|
|
|
|
WHEN zab."TYPE" = 'S' THEN '设备异常'
|
|
|
|
|
WHEN zab."TYPE" = 'Q' THEN '其他异常' END ABNORMAL_TYPE,
|
|
|
|
|
zab.OPERATION OPERATION ,ot.DESCRIPTION OPERATION_DESCRIPTION,r.RESRCE RESRCE,r.DESCRIPTION RESRCE_DESCRIPTION,
|
|
|
|
|
zab.CREATED_DATE_TIME CREATED_DATE_TIME ,znu.FULL_NAME PB_USER,znu2.FULL_NAME REPORT_USER,
|
|
|
|
|
LISTAGG(nct.DESCRIPTION , ';') WITHIN GROUP(ORDER BY zab.ABNORMAL_NO) NC_CODE_DESCRIPTION,
|
|
|
|
|
CASE WHEN zab.STATUS = 'N' THEN '新建'
|
|
|
|
|
WHEN zab.STATUS = 'X' THEN '响应中'
|
|
|
|
|
WHEN zab.STATUS = 'F' THEN '方案确认'
|
|
|
|
|
WHEN zab.STATUS = 'J' THEN '纠防确认'
|
|
|
|
|
WHEN zab.STATUS = 'Q' THEN '取消'
|
|
|
|
|
WHEN zab.STATUS = 'G' THEN '关闭' END ABNORMAL_STATUS,
|
|
|
|
|
CASE WHEN zabd.ABNORMAL_METHOD = 'X' THEN '线下换料'
|
|
|
|
|
WHEN zabd.ABNORMAL_METHOD = 'S' THEN '试装'
|
|
|
|
|
WHEN zabd.ABNORMAL_METHOD = 'R' THEN '让步放心'
|
|
|
|
|
WHEN zabd.ABNORMAL_METHOD = 'C' THEN '报废'
|
|
|
|
|
WHEN zabd.ABNORMAL_METHOD = 'P' THEN '配作'
|
|
|
|
|
WHEN zabd.ABNORMAL_METHOD = 'F' THEN '返修'
|
|
|
|
|
ELSE ''
|
|
|
|
|
END ABNORMAL_METHOD,zabd.RESOLVE_DATE_TIME RESOLVE_DATE_TIME,
|
|
|
|
|
znu3.FULL_NAME RESOLVE_USER,zabd.CLOSED_DATE_TIME CANCEL_DATE_TIME ,
|
|
|
|
|
znu4.FULL_NAME CANCEL_USER,zabd.RESOLVE_REMARK RESOLVE_REMARK,
|
|
|
|
|
zabd.ABNORMAL_REASON ABNORMAL_REASON,zabd.BEFORE_MEASURE BEFORE_MEASURE
|
|
|
|
|
FROM Z_ABNORMAL_BILL zab
|
|
|
|
|
LEFT JOIN Z_ABNORMAL_NC_CODE zanc ON zanc.ABNORMAL_BILL_BO = zab.HANDLE
|
|
|
|
|
LEFT JOIN Z_ABNORMAL_BILL_DISPOSE zabd ON zabd.ABNORMAL_BILL_BO = zab.HANDLE
|
|
|
|
|
LEFT JOIN WORK_CENTER wc ON wc.WORK_CENTER = SUBSTR(zab.OPERATION,1,INSTR(zab.OPERATION,'_')-1)
|
|
|
|
|
LEFT JOIN NC_CODE nc ON zanc.NC_CODE = nc.NC_CODE AND nc.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN NC_CODE_T nct ON nct.NC_CODE_BO = nc.HANDLE AND nct.LOCALE = 'zh'
|
|
|
|
|
LEFT JOIN SHOP_ORDER so ON so.SHOP_ORDER = zab.SHOP_ORDER AND so.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN CUSTOM_FIELDS cf ON cf.HANDLE = so.HANDLE
|
|
|
|
|
INNER JOIN ITEM i ON i.HANDLE = zab.ITEM_BO
|
|
|
|
|
LEFT JOIN ITEM_T it ON it.ITEM_BO = i.HANDLE AND it.LOCALE = 'zh'
|
|
|
|
|
LEFT JOIN OPERATION o ON o.OPERATION = zab.OPERATION AND o.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN OPERATION_T ot ON ot.OPERATION_BO = o.HANDLE AND ot.LOCALE = 'zh'
|
|
|
|
|
LEFT JOIN RESRCE r ON r.RESRCE = zab.RESRCE AND r.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN Z_NWA_USER znu ON znu.USER_NAME = zab.PB_USER
|
|
|
|
|
LEFT JOIN Z_NWA_USER znu2 ON znu2.USER_NAME = zab.CREATED_USER
|
|
|
|
|
LEFT JOIN Z_NWA_USER znu3 ON znu3.USER_NAME = zabd.RESOLVE_USER
|
|
|
|
|
LEFT JOIN Z_NWA_USER znu4 ON znu4.USER_NAME = zabd.CLOSED_USER
|
|
|
|
|
GROUP BY wc.WORK_CENTER ,zab.PRODUCT_CATEGORY ,cf.VALUE ,so.SHOP_ORDER ,
|
|
|
|
|
i.ITEM ,it.DESCRIPTION,zab.SFC,zab."TYPE" ,zab.ABNORMAL_NO,
|
|
|
|
|
zab.OPERATION,ot.DESCRIPTION,r.RESRCE,r.DESCRIPTION,
|
|
|
|
|
zab.CREATED_DATE_TIME ,znu.FULL_NAME,znu2.FULL_NAME,
|
|
|
|
|
zab.STATUS,zabd.ABNORMAL_METHOD,zabd.RESOLVE_DATE_TIME ,
|
|
|
|
|
znu3.FULL_NAME,zabd.CLOSED_DATE_TIME ,znu4.FULL_NAME,
|
|
|
|
|
zabd.RESOLVE_REMARK,zabd.ABNORMAL_REASON,zabd.BEFORE_MEASURE
|
|
|
|
|
ORDER BY zab.CREATED_DATE_TIME DESC
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|