change - 返修率、焊漏率

master
yinq 4 months ago
parent 14d996b26a
commit 43e1be41ce

@ -165,7 +165,8 @@ public class QualityReportServiceImpl implements IQualityReportService {
String[] stationCodeLists = String.valueOf(hashMap.get("stationCodeList")).split(","); String[] stationCodeLists = String.valueOf(hashMap.get("stationCodeList")).split(",");
hashMap.put("stationCodeList", stationCodeLists); hashMap.put("stationCodeList", stationCodeLists);
for (String station : stationCodeLists) { for (String station : stationCodeLists) {
if (station.equals("2001") || station.equals("2006") || station.equals("2007")) { if (station.equals("2001") || station.equals("2006") || station.equals("2007")
|| station.equals("2101") || station.equals("2106") || station.equals("2107")) {
hashMap.put("leakFlag", "1"); hashMap.put("leakFlag", "1");
} }
} }
@ -360,7 +361,6 @@ public class QualityReportServiceImpl implements IQualityReportService {
List<WeldLeakRateReport> weldLeakRateReports = reportMapper.weldLeakRateListMonth(hashMap); List<WeldLeakRateReport> weldLeakRateReports = reportMapper.weldLeakRateListMonth(hashMap);
return weldLeakRateReports; return weldLeakRateReports;
} }
String month = hashMap.get("month").toString();
return reportMapper.weldLeakRateList(hashMap); return reportMapper.weldLeakRateList(hashMap);
} }

@ -806,23 +806,29 @@
WEEK_END, WEEK_END,
NVL(COUNT(*), 0) Q_SUM, NVL(COUNT(*), 0) Q_SUM,
NVL(SUM(LEAK_SUM), 0) LEAK_SUM, NVL(SUM(LEAK_SUM), 0) LEAK_SUM,
TO_CHAR(ROUND(SUM(LEAK_SUM) / COUNT(*) * 100, 2), 'FM99990.00') REPAIR_RATE, TO_CHAR(ROUND(SUM(LEAK_SUM) / COUNT(*) * 100, 2), 'FM99990.00') REPAIR_RATE,
'二线' PRODUCT_LINE_NAME PRODUCT_LINE_NAME PRODUCT_LINE_NAME
FROM ( FROM (
SELECT TO_NUMBER(COLUMN_A) WEEK_NUMBER, SELECT TO_NUMBER(COLUMN_A) WEEK_NUMBER,
COLUMN_B WEEK_START, COLUMN_B WEEK_START,
COLUMN_C WEEK_END, COLUMN_C WEEK_END,
P2.PRODUCT_LINE_NAME,
BAR_CODE, BAR_CODE,
MAX(CASE WHEN QUALITY_DEFECT_NAME LIKE '%漏%' THEN 1 ELSE 0 END) LEAK_SUM MAX(CASE WHEN QUALITY_DEFECT_NAME LIKE '%漏%' THEN 1 ELSE 0 END) LEAK_SUM
FROM (SELECT COLUMN_A, COLUMN_B, COLUMN_C FROM (SELECT COLUMN_A, COLUMN_B, COLUMN_C
FROM TABLE (GET_YEAR_WEEK_TIME(${year}))) WEE FROM TABLE (GET_YEAR_WEEK_TIME(${year}))) WEE
LEFT JOIN REPORT_QUALITY_INSPECTION RQI LEFT JOIN REPORT_QUALITY_INSPECTION RQI
LEFT JOIN BASE_PRODUCTLINE BP on RQI.STATION_CODE = BP.PRODUCT_LINE_CODE
LEFT JOIN BASE_PRODUCTLINE P2 on P2.PRODUCT_LINE_CODE = BP.PARENT_ID
ON RQI.BAR_CODE LIKE 'B%' AND ON RQI.BAR_CODE LIKE 'B%' AND
TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') > WEE.COLUMN_B AND TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') > WEE.COLUMN_B AND
TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') &lt;= WEE.COLUMN_C TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') &lt;= WEE.COLUMN_C
GROUP BY COLUMN_A, COLUMN_B, COLUMN_C, BAR_CODE <if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">
WHERE P2.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}
</if>
GROUP BY COLUMN_A, COLUMN_B, COLUMN_C, P2.PRODUCT_LINE_NAME, BAR_CODE
) )
GROUP BY WEEK_NUMBER, WEEK_START, WEEK_END GROUP BY PRODUCT_LINE_NAME, WEEK_NUMBER, WEEK_START, WEEK_END
ORDER BY WEEK_NUMBER ORDER BY WEEK_NUMBER
</select> </select>
@ -833,22 +839,25 @@
NVL(COUNT(*), 0) Q_SUM, NVL(COUNT(*), 0) Q_SUM,
NVL(SUM(LEAK_SUM), 0) LEAK_SUM, NVL(SUM(LEAK_SUM), 0) LEAK_SUM,
TO_CHAR(ROUND(SUM(LEAK_SUM) / COUNT(*) * 100, 2), 'FM99990.00') REPAIR_RATE, TO_CHAR(ROUND(SUM(LEAK_SUM) / COUNT(*) * 100, 2), 'FM99990.00') REPAIR_RATE,
'二线' PRODUCT_LINE_NAME PRODUCT_LINE_NAME PRODUCT_LINE_NAME
FROM ( FROM (
SELECT TO_NUMBER(COLUMN_A) WEEK_NUMBER, SELECT TO_NUMBER(COLUMN_A) WEEK_NUMBER,
COLUMN_B WEEK_START, COLUMN_B WEEK_START,
COLUMN_C WEEK_END, COLUMN_C WEEK_END,
P2.PRODUCT_LINE_NAME,
BAR_CODE, BAR_CODE,
MAX(CASE WHEN QUALITY_DEFECT_NAME LIKE '%漏%' THEN 1 ELSE 0 END) LEAK_SUM MAX(CASE WHEN QUALITY_DEFECT_NAME LIKE '%漏%' THEN 1 ELSE 0 END) LEAK_SUM
FROM (SELECT COLUMN_A, COLUMN_B, COLUMN_C FROM (SELECT COLUMN_A, COLUMN_B, COLUMN_C
FROM TABLE (GET_YEAR_MONTH_TIME(${year}))) WEE FROM TABLE (GET_YEAR_MONTH_TIME(${year}))) WEE
LEFT JOIN REPORT_QUALITY_INSPECTION RQI LEFT JOIN REPORT_QUALITY_INSPECTION RQI
LEFT JOIN BASE_PRODUCTLINE BP on RQI.STATION_CODE = BP.PRODUCT_LINE_CODE
LEFT JOIN BASE_PRODUCTLINE P2 on P2.PRODUCT_LINE_CODE = BP.PARENT_ID
ON RQI.BAR_CODE LIKE 'B%' AND ON RQI.BAR_CODE LIKE 'B%' AND
TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') > WEE.COLUMN_B AND TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') > WEE.COLUMN_B AND
TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') &lt;= WEE.COLUMN_C TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') &lt;= WEE.COLUMN_C
GROUP BY COLUMN_A, COLUMN_B, COLUMN_C, BAR_CODE GROUP BY COLUMN_A, COLUMN_B, COLUMN_C, P2.PRODUCT_LINE_NAME ,BAR_CODE
) )
GROUP BY WEEK_NUMBER, WEEK_START, WEEK_END GROUP BY PRODUCT_LINE_NAME, WEEK_NUMBER, WEEK_START, WEEK_END
ORDER BY WEEK_NUMBER ORDER BY WEEK_NUMBER
</select> </select>

Loading…
Cancel
Save