|
|
|
@ -520,13 +520,14 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="repairRateReportList" resultType="com.aucma.report.domain.RepairRateReport"
|
|
|
|
|
parameterType="java.util.HashMap">
|
|
|
|
|
SELECT RQI.INSPECTOR_TIME,
|
|
|
|
|
RQI.QUALITY_SUM,
|
|
|
|
|
VPO.OFF_LINE_NUM,
|
|
|
|
|
CASE
|
|
|
|
|
WHEN NVL(OFF_LINE_NUM, 0) = 0 THEN '0.00'
|
|
|
|
|
ELSE TO_CHAR(ROUND(QUALITY_SUM / NVL(OFF_LINE_NUM, 0) * 100, 2), 'FM99990.00') END || '%' REPAIR_RATE,
|
|
|
|
|
TARGET
|
|
|
|
|
SELECT VPO.PRODUCT_SCANTIME INSPECTOR_TIME,
|
|
|
|
|
NVL(RQI.QUALITY_SUM, 0) QUALITY_SUM,
|
|
|
|
|
VPO.OFF_LINE_NUM,
|
|
|
|
|
CASE
|
|
|
|
|
WHEN NVL(OFF_LINE_NUM, 0) = 0 THEN '0.00'
|
|
|
|
|
ELSE TO_CHAR(ROUND(NVL(RQI.QUALITY_SUM, 0) / NVL(OFF_LINE_NUM, 1) * 100, 2), 'FM99990.00') END ||
|
|
|
|
|
'%' REPAIR_RATE,
|
|
|
|
|
TARGET
|
|
|
|
|
FROM (SELECT INSPECTOR_TIME, COUNT(*) QUALITY_SUM
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD') INSPECTOR_TIME, RQI.BAR_CODE
|
|
|
|
@ -547,7 +548,7 @@
|
|
|
|
|
GROUP BY TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD'), RQI.BAR_CODE
|
|
|
|
|
)
|
|
|
|
|
GROUP BY INSPECTOR_TIME) RQI
|
|
|
|
|
LEFT JOIN (
|
|
|
|
|
RIGHT JOIN (
|
|
|
|
|
SELECT PRODUCT_SCANTIME, COUNT(*) OFF_LINE_NUM
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT TO_CHAR(VPO.PRODUCT_SCANTIME, 'YYYY-MM-DD') PRODUCT_SCANTIME,
|
|
|
|
@ -556,6 +557,9 @@
|
|
|
|
|
WHERE VPO.BOX_CODE IS NOT NULL
|
|
|
|
|
<if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">
|
|
|
|
|
AND VPO.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
|
|
|
|
|
AND TO_CHAR(VPO.PRODUCT_SCANTIME, 'YYYY-MM-DD') BETWEEN #{beginBeginTime} AND #{endBeginTime}
|
|
|
|
|
</if>
|
|
|
|
|
GROUP BY TO_CHAR(VPO.PRODUCT_SCANTIME, 'YYYY-MM-DD'), VPO.BOX_CODE
|
|
|
|
|
)
|
|
|
|
@ -564,7 +568,7 @@
|
|
|
|
|
CROSS JOIN (SELECT TO_CHAR(CUSTOM_DATA) TARGET
|
|
|
|
|
FROM BASE_CUSTOM_DATA
|
|
|
|
|
WHERE CUSTOM_CODE = 'REPAIR_RATE_' || #{PRODUCT_LINE_CODE}) TARGET
|
|
|
|
|
ORDER BY RQI.INSPECTOR_TIME
|
|
|
|
|
ORDER BY VPO.PRODUCT_SCANTIME
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="boxTurnoverTraceabilityReportList" resultType="com.aucma.report.domain.BoxTurnoverTraceabilityReport"
|
|
|
|
@ -579,11 +583,13 @@
|
|
|
|
|
PO.PRODUCT_SNCODE,
|
|
|
|
|
PB.MATERIAL_BARCODE BOX_CODE,
|
|
|
|
|
PO.PRODUCT_SCANTIME,
|
|
|
|
|
PB.PRINT_TIME
|
|
|
|
|
PB.PRINT_TIME,
|
|
|
|
|
CB.LINER_CODE
|
|
|
|
|
FROM C##AUCMA_SCADA.PRINT_BARCODE PB
|
|
|
|
|
LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = PB.ORDER_CODE
|
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE PL ON PL.WORK_CENTER_CODE = BO.WORK_CENTER_CODE
|
|
|
|
|
LEFT JOIN C##AUCMA_SCADA.PRODUCT_OFFLINE PO ON PB.MATERIAL_BARCODE = PO.BOX_CODE
|
|
|
|
|
LEFT JOIN C##AUCMA_SCADA.CODE_BINDING CB ON CB.BOX_CODE = PB.MATERIAL_BARCODE
|
|
|
|
|
<where>
|
|
|
|
|
PB.PRINT_BARTYPE = 1
|
|
|
|
|
<if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">and PL.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}
|
|
|
|
|