|
|
|
@ -85,6 +85,10 @@
|
|
|
|
|
<if test="param.item != null and param.item != ''">
|
|
|
|
|
AND (I.ITEM = #{param.item} OR IT.DESCRIPTION = #{param.item})
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.currentOperation != null and param.currentOperation != ''">
|
|
|
|
|
AND (OT2.DESCRIPTION LIKE '%${param.currentOperation}%' OR
|
|
|
|
|
O2.OPERATION LIKE '%${param.currentOperation}%')
|
|
|
|
|
</if>
|
|
|
|
|
<!-- <if test="param.itemDescription != null and param.itemDescription != ''">-->
|
|
|
|
|
<!-- AND IT.DESCRIPTION LIKE '%${param.itemDescription}%'-->
|
|
|
|
|
<!-- </if>-->
|
|
|
|
@ -119,7 +123,7 @@
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="surplusReturnTable" resultType="map">
|
|
|
|
|
<select id="surplusReturnTable" resultType="java.util.HashMap">
|
|
|
|
|
SELECT ZSR.INVENTORY INVENTORY,ZSR.ITEM_BO ITEM_BO,IT.DESCRIPTION ITEM_DESCRIPTION,ZSR.LENGHT LENGHT,
|
|
|
|
|
ZSR.WIDTH WIDTH,ZSR.NUMBERS NUMBERS,ZSR.QTY QTY,ZSR.CREATED_DATE_TIME CREATED_DATE_TIME,I.ITEM ITEM
|
|
|
|
|
FROM
|
|
|
|
@ -137,7 +141,7 @@
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="resourceRepair" resultType="map">
|
|
|
|
|
<select id="resourceRepair" resultType="java.util.HashMap">
|
|
|
|
|
SELECT
|
|
|
|
|
ZRRT.HANDLE HANDLE,
|
|
|
|
|
CASE WHEN WC2.WORK_CENTER != 'NULL' THEN WC2.WORK_CENTER
|
|
|
|
@ -154,15 +158,15 @@
|
|
|
|
|
END ITEM_DESCRIPTION,
|
|
|
|
|
CF.VALUE ITEM_SPEC,
|
|
|
|
|
ZRRT.ACTUAL_START_DATE ACTUAL_START_DATE,ZRRT.ACTUAL_COMPLETE_DATE ACTUAL_COMPLETE_DATE,
|
|
|
|
|
CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TRUNC(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME)*24),2)
|
|
|
|
|
WHEN ZRRT.STOP_MACHINE = 'N' THEN TRUNC(TO_NUMBER((SYSDATE-ZRRT.CREATED_DATE_TIME)*24),2)
|
|
|
|
|
CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TO_CHAR(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME)*24),'FM9999990.00')
|
|
|
|
|
WHEN ZRRT.STOP_MACHINE = 'N' THEN TO_CHAR(TO_NUMBER((SYSDATE-ZRRT.CREATED_DATE_TIME)*24),'FM9999990.00')
|
|
|
|
|
END SHUT_DOWN_TIME,
|
|
|
|
|
CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TRUNC(TO_NUMBER((ZRRT.WAIT_END_DATE -ZRRT.WAIT_START_DATE)*24),2)
|
|
|
|
|
WHEN ZRRT.STOP_MACHINE = 'N' THEN TRUNC(TO_NUMBER((SYSDATE-ZRRT.WAIT_START_DATE)*24),2)
|
|
|
|
|
CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TO_CHAR(TO_NUMBER((ZRRT.WAIT_END_DATE -ZRRT.WAIT_START_DATE)*24),'FM9999990.00')
|
|
|
|
|
WHEN ZRRT.STOP_MACHINE = 'N' THEN TO_CHAR(TO_NUMBER((SYSDATE-ZRRT.WAIT_START_DATE)*24),'FM9999990.00')
|
|
|
|
|
END REPAIR_WAIT_TIME,
|
|
|
|
|
|
|
|
|
|
CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TRUNC(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),2)
|
|
|
|
|
WHEN ZRRT.STOP_MACHINE = 'N' THEN TRUNC(TO_NUMBER((SYSDATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),2)
|
|
|
|
|
CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TO_CHAR(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),'FM9999990.00')
|
|
|
|
|
WHEN ZRRT.STOP_MACHINE = 'N' THEN TO_CHAR(TO_NUMBER((SYSDATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),'FM9999990.00')
|
|
|
|
|
END REPAIR_TIME,
|
|
|
|
|
CASE WHEN ZRRT.STATUS = '401' THEN '待维修'
|
|
|
|
|
WHEN ZRRT.STATUS = '501' THEN '维修中'
|
|
|
|
@ -177,7 +181,7 @@
|
|
|
|
|
Z_RESOURCE_REPAIR_TASK ZRRT
|
|
|
|
|
INNER JOIN RESRCE R ON R.RESRCE = ZRRT.RESOURCE_NO AND R.SITE = ZRRT.SITE
|
|
|
|
|
INNER JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE
|
|
|
|
|
LEFT JOIN WORK_CENTER WC ON WC.HANDLE = WCM.WORK_CENTER_BO AND WC.WC_CATEGORY ='LEVEL3'
|
|
|
|
|
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'
|
|
|
|
@ -255,12 +259,7 @@
|
|
|
|
|
<select id="findQualityInspectionReport" parameterType="java.util.HashMap" resultType="java.util.HashMap">
|
|
|
|
|
SELECT zab.CREATED_DATE_TIME,zab.ABNORMAL_NO ABNORMAL_NO,
|
|
|
|
|
dflt.DATA_TAG PRODUCT_CATEGORY,
|
|
|
|
|
CASE WHEN zab.DISCOVER = 'Z' THEN '自制'
|
|
|
|
|
WHEN zab.DISCOVER = 'W' THEN '外协'
|
|
|
|
|
WHEN zab.DISCOVER = 'D' THEN '到货'
|
|
|
|
|
WHEN zab.DISCOVER = 'K' THEN '客户'
|
|
|
|
|
ELSE ''
|
|
|
|
|
END DISCOVER ,
|
|
|
|
|
dflt2.DATA_TAG DISCOVER,
|
|
|
|
|
i.ITEM ITEM ,it.DESCRIPTION ITEM_DESCRIPTION,itemNumber.VALUE ITEM_NUMBER,
|
|
|
|
|
mapNo.VALUE MAP_NO,zab.PB_DESCRIPTION PB_DESCRIPTION,zsd.EMPLOYEE_DESCRIPTION OPERATOR,
|
|
|
|
|
CASE WHEN zab."TYPE" = 'Z' THEN '质量异常'
|
|
|
|
@ -287,7 +286,7 @@
|
|
|
|
|
zsd.EMPLOYEE_DESCRIPTION DISPATCH_USER ,ot.DESCRIPTION OPERATION ,
|
|
|
|
|
r2.RESRCE RESRCE,r2.DESCRIPTION RESRCE_DESCRIPTION,zsd.RESOURCE_TYPE RESOURCE_TYPE,
|
|
|
|
|
rt.DESCRIPTION RESOURCE_TYPE_DESCRIPTION,zabd.DUTY_CAUSE_TYPE DUTY_CAUSE_TYPE,zabd.DUTY_TYPE DUTY_TYPE,
|
|
|
|
|
zabd.DUTY_DEPART DUTY_DEPART
|
|
|
|
|
zabd.DUTY_DEPART DUTY_DEPART,TO_CHAR(TO_NUMBER(zabd.CLOSED_DATE_TIME - zab.RESPONSE_DATE_TIME)*24,'FM9999990.00') WORKING_HOURS
|
|
|
|
|
FROM Z_ABNORMAL_BILL zab
|
|
|
|
|
INNER JOIN Z_ABNORMAL_BILL_DISPOSE zabd ON zab.HANDLE = zabd.ABNORMAL_BILL_BO
|
|
|
|
|
LEFT JOIN Z_ABNORMAL_NC_CODE zanc ON zab.HANDLE = zanc.ABNORMAL_BILL_BO
|
|
|
|
@ -295,9 +294,14 @@
|
|
|
|
|
LEFT JOIN NC_CODE_T nct ON nct.NC_CODE_BO = nc.HANDLE AND nct.LOCALE = #{locale}
|
|
|
|
|
INNER JOIN ITEM i ON i.HANDLE = zab.ITEM_BO
|
|
|
|
|
LEFT JOIN ITEM_T it ON it.ITEM_BO = i.HANDLE AND it.LOCALE = #{locale}
|
|
|
|
|
|
|
|
|
|
INNER JOIN DATA_FIELD df ON df.DATA_FIELD = 'PRODUCT_CATEGORY'
|
|
|
|
|
LEFT JOIN DATA_FIELD_LIST dfl ON dfl.DATA_FIELD_BO = df.HANDLE AND dfl.DATA_VALUE = zab.PRODUCT_CATEGORY
|
|
|
|
|
LEFT JOIN DATA_FIELD_LIST_T dflt ON dflt.DATA_FIELD_LIST_BO = dfl.HANDLE AND dflt.LOCALE = #{locale}
|
|
|
|
|
INNER JOIN DATA_FIELD df2 ON df2.DATA_FIELD = 'DISCOVER'
|
|
|
|
|
LEFT JOIN DATA_FIELD_LIST dfl2 ON dfl2.DATA_FIELD_BO = df2.HANDLE AND dfl2.DATA_VALUE = zab.DISCOVER
|
|
|
|
|
LEFT JOIN DATA_FIELD_LIST_T dflt2 ON dflt2.DATA_FIELD_LIST_BO = dfl2.HANDLE AND dflt2.LOCALE = #{locale}
|
|
|
|
|
|
|
|
|
|
LEFT JOIN CUSTOM_FIELDS mapNo ON mapNo."ATTRIBUTE" = 'DWG_NO' AND mapNo.HANDLE = i.HANDLE
|
|
|
|
|
LEFT JOIN SHOP_ORDER so ON so.SHOP_ORDER = zab.SHOP_ORDER AND so.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN ROUTER r ON r.HANDLE = zabd.ROUTER_BO
|
|
|
|
@ -348,14 +352,14 @@
|
|
|
|
|
GROUP BY zab.CREATED_DATE_TIME ,zab.ABNORMAL_NO ,
|
|
|
|
|
i.ITEM ,it.DESCRIPTION ,itemNumber.VALUE ,
|
|
|
|
|
mapNo.VALUE ,zab.PB_DESCRIPTION ,zsd.EMPLOYEE_DESCRIPTION ,
|
|
|
|
|
zab."TYPE" ,zab.REPORT_SEND_USER_GROUP ,zabd.DUTY_DEPART ,zabd.PRINCIPAL_USER,DISCOVER ,
|
|
|
|
|
zab."TYPE" ,zab.REPORT_SEND_USER_GROUP ,zabd.DUTY_DEPART ,zabd.PRINCIPAL_USER,
|
|
|
|
|
zab.PB_GRADE,zabd.DUTY_CAUSE_DESCRIPTION ,zabd.BEFORE_MEASURE,ABNORMAL_METHOD,
|
|
|
|
|
zabd.RESOLVE_REMARK ,zabd.RESOLVE_USER ,
|
|
|
|
|
zabd.CLOSED_DATE_TIME ,zab.NC_QTY ,zab.PB_QTY ,zab.SHOP_ORDER,so.QTY_TO_BUILD,
|
|
|
|
|
zsd.EMPLOYEE_DESCRIPTION ,ot.DESCRIPTION ,
|
|
|
|
|
r2.RESRCE,r2.DESCRIPTION,zsd.RESOURCE_TYPE,
|
|
|
|
|
rt.DESCRIPTION, dflt.DATA_TAG,zabd.DUTY_CAUSE_TYPE,zabd.DUTY_TYPE ,zabd.DUTY_DEPART,
|
|
|
|
|
znu.FULL_NAME,znu2.FULL_NAME
|
|
|
|
|
znu.FULL_NAME,znu2.FULL_NAME,zab.RESPONSE_DATE_TIME,dflt2.DATA_TAG
|
|
|
|
|
ORDER BY zab.CREATED_DATE_TIME DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -389,7 +393,7 @@
|
|
|
|
|
znu4.FULL_NAME CANCEL_USER,zabd.RESOLVE_REMARK RESOLVE_REMARK,
|
|
|
|
|
zabd.ABNORMAL_REASON ABNORMAL_REASON,zabd.BEFORE_MEASURE BEFORE_MEASURE,
|
|
|
|
|
ug.DESCRIPTION RESOLVE_SEND_USER_GROUP,
|
|
|
|
|
TRUNC(TO_NUMBER(zabd.RESOLVE_DATE_TIME - zsr.CREATED_DATE_TIME)*24,2) RESOLVE_DURATION,
|
|
|
|
|
TO_CHAR(TO_NUMBER(zabd.RESOLVE_DATE_TIME - zsr.CREATED_DATE_TIME)*24,'FM9999990.00') RESOLVE_DURATION,
|
|
|
|
|
zabd.DUTY_DEPART DUTY_DEPART
|
|
|
|
|
FROM Z_ABNORMAL_BILL zab
|
|
|
|
|
LEFT JOIN Z_ABNORMAL_NC_CODE zanc ON zanc.ABNORMAL_BILL_BO = zab.HANDLE
|
|
|
|
@ -458,7 +462,7 @@
|
|
|
|
|
CASE WHEN zab.HANDLE IS NOT NULL THEN '是'
|
|
|
|
|
ELSE '否'
|
|
|
|
|
END IS_ANOMALY,
|
|
|
|
|
CASE WHEN zsd.PLANNED_COMP_DATE IS NOT NULL THEN TRUNC(TO_NUMBER(zsd.PLANNED_COMP_DATE - SYSDATE),2) || '天'
|
|
|
|
|
CASE WHEN zsd.PLANNED_COMP_DATE IS NOT NULL THEN TO_CHAR(TO_NUMBER(zsd.PLANNED_COMP_DATE - SYSDATE),'FM9999990.00')
|
|
|
|
|
ELSE ''
|
|
|
|
|
END SURPLUS_DAY
|
|
|
|
|
FROM Z_SFC_DISPATCH zsd
|
|
|
|
|