|
|
|
@ -225,9 +225,9 @@
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="findQualityInspectionReport" resultType="map">
|
|
|
|
|
SELECT zab.CREATED_DATE_TIME CREATED_DATE_TIME,zab.ABNORMAL_NO ABNORMAL_NO,
|
|
|
|
|
zab.PRODUCT_CATEGORY PRODUCT_CATEGORY,
|
|
|
|
|
<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 '到货'
|
|
|
|
@ -239,7 +239,6 @@
|
|
|
|
|
CASE WHEN zab."TYPE" = 'Z' THEN '质量异常'
|
|
|
|
|
WHEN zab."TYPE" = 'Q' THEN '其他异常'
|
|
|
|
|
WHEN zab."TYPE" = 'S' THEN '设备异常' END "TYPE",
|
|
|
|
|
|
|
|
|
|
zab.REPORT_SEND_USER_GROUP INSPECTOR ,
|
|
|
|
|
zab.PB_GRADE PB_GRADE ,
|
|
|
|
|
zabd.PRINCIPAL_USER PRINCIPAL_USER,
|
|
|
|
@ -257,7 +256,9 @@
|
|
|
|
|
CASE WHEN (zabd.ABNORMAL_METHOD ='F' AND zab.SHOP_ORDER IS NOT NULL) THEN TO_CHAR(so.QTY_TO_BUILD,'9999')
|
|
|
|
|
WHEN zabd.ABNORMAL_METHOD = 'F' THEN TO_CHAR(zab.PB_QTY,'9999') ELSE '' END NUMBERS,
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
@ -265,6 +266,9 @@
|
|
|
|
|
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}
|
|
|
|
|
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
|
|
|
|
@ -278,7 +282,37 @@
|
|
|
|
|
LEFT JOIN OPERATION_T ot ON ot.OPERATION_BO = o.HANDLE AND ot.LOCALE = #{locale}
|
|
|
|
|
LEFT JOIN RESRCE r2 ON r2.RESRCE = zsd.RESRCE AND r2.SITE = zab.SITE
|
|
|
|
|
LEFT JOIN RESOURCE_TYPE rt ON rt.RESOURCE_TYPE = zsd.RESOURCE_TYPE AND rt.SITE = zab.SITE
|
|
|
|
|
WHERE zab."TYPE" ='Z'
|
|
|
|
|
LEFT JOIN WORK_CENTER wc ON wc.WORK_CENTER = SUBSTR(o.OPERATION,1,INSTR(o.OPERATION,'_')-1) AND wc.site = zab.SITE
|
|
|
|
|
<where>
|
|
|
|
|
zab."TYPE" ='Z'
|
|
|
|
|
<if test="workCenter != null and workCenter != ''">
|
|
|
|
|
AND wc.WORK_CENTER LIKE '%${workCenter}%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="itemNumber != null and itemNumber != ''">
|
|
|
|
|
AND itemNumber.VALUE = #{itemNumber}
|
|
|
|
|
</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>
|
|
|
|
|
<if test="resrce != null and resrce != ''">
|
|
|
|
|
AND (r2.RESRCE LIKE '%${resrce}%' OR
|
|
|
|
|
r2.DESCRIPTION LIKE '%${resrce}%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startDateTime != null">
|
|
|
|
|
AND zab.CREATED_DATE_TIME >= TO_DATE(#{startDateTime},'YYYY-MM-DD')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endDateTime != null">
|
|
|
|
|
AND zab.CREATED_DATE_TIME <= TO_DATE(#{endDateTime},'YYYY-MM-DD')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY zab.CREATED_DATE_TIME ,zab.ABNORMAL_NO ,
|
|
|
|
|
i.ITEM ,it.DESCRIPTION ,itemNumber.VALUE ,
|
|
|
|
|
mapNo.VALUE ,zab.PB_DESCRIPTION ,zsd.EMPLOYEE_DESCRIPTION ,
|
|
|
|
@ -288,6 +322,7 @@
|
|
|
|
|
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,zab.PRODUCT_CATEGORY
|
|
|
|
|
rt.DESCRIPTION, dflt.DATA_TAG,zabd.DUTY_CAUSE_TYPE,zabd.DUTY_TYPE ,zabd.DUTY_DEPART
|
|
|
|
|
ORDER BY zab.CREATED_DATE_TIME DESC
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|