|
|
|
@ -40,34 +40,51 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="homeColumnarInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
|
|
|
|
SELECT TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BEGIN_DATE,
|
|
|
|
|
bm.PRODUCT_LINE_CODE,
|
|
|
|
|
SUM(boi.COMPLETE_AMOUNT) COMPLETE_AMOUNT,
|
|
|
|
|
ROUND(SUM(boi.COMPLETE_AMOUNT) / SUM(boi.ORDER_AMOUNT) * 100, 0) RATE
|
|
|
|
|
FROM BASE_ORDERINFO boi
|
|
|
|
|
JOIN BASE_MATERIALINFO bm ON bm.MATERIAL_CODE = boi.material_code AND bm.DISPO IN ('100')
|
|
|
|
|
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN TO_CHAR(SYSDATE - 2, 'YYYY-MM-DD') AND TO_CHAR(SYSDATE - 1, 'YYYY-MM-DD')
|
|
|
|
|
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD')
|
|
|
|
|
JOIN BASE_PRODUCTLINE bm ON bm.WORK_CENTER_CODE = boi.WORK_CENTER_CODE
|
|
|
|
|
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') IN
|
|
|
|
|
(SELECT TO_CHAR(TRUNC(SYSDATE, 'IW') + LEVEL - 1, 'YYYY-MM-DD') AS day_of_week
|
|
|
|
|
FROM DUAL
|
|
|
|
|
CONNECT BY LEVEL <= 7)
|
|
|
|
|
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD'), bm.PRODUCT_LINE_CODE
|
|
|
|
|
ORDER BY BEGIN_DATE
|
|
|
|
|
</select>
|
|
|
|
|
<select id="homeLineInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
|
|
|
|
SELECT TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BEGIN_DATE,
|
|
|
|
|
bm.PRODUCT_LINE_CODE,
|
|
|
|
|
ROUND(SUM(CASE WHEN boi.COMPLETE_AMOUNT = boi.ORDER_AMOUNT THEN 1 ELSE 0 END) / COUNT(*) * 100,
|
|
|
|
|
2) COMPLETE_AMOUNT
|
|
|
|
|
FROM BASE_ORDERINFO boi
|
|
|
|
|
JOIN BASE_MATERIALINFO bm ON bm.MATERIAL_CODE = boi.material_code AND bm.DISPO IN ('100')
|
|
|
|
|
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN TO_CHAR(SYSDATE - 2, 'YYYY-MM-DD') AND TO_CHAR(SYSDATE - 1, 'YYYY-MM-DD')
|
|
|
|
|
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD')
|
|
|
|
|
JOIN BASE_PRODUCTLINE bm ON bm.WORK_CENTER_CODE = boi.WORK_CENTER_CODE
|
|
|
|
|
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') IN
|
|
|
|
|
(SELECT TO_CHAR(TRUNC(SYSDATE, 'IW') + LEVEL - 1, 'YYYY-MM-DD') AS day_of_week
|
|
|
|
|
FROM DUAL
|
|
|
|
|
CONNECT BY LEVEL <= 7)
|
|
|
|
|
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD'), bm.PRODUCT_LINE_CODE
|
|
|
|
|
ORDER BY BEGIN_DATE
|
|
|
|
|
</select>
|
|
|
|
|
<select id="homePieChartInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
|
|
|
|
SELECT QUALITY_DEFECT_NAME, SUM
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT QUALITY_DEFECT_NAME, COUNT(*) SUM
|
|
|
|
|
FROM REPORT_QUALITY_INSPECTION
|
|
|
|
|
WHERE QUALITY_DEFECT_NAME IS NOT NULL
|
|
|
|
|
GROUP BY QUALITY_DEFECT_NAME
|
|
|
|
|
ORDER BY SUM
|
|
|
|
|
SELECT xl.DICT_LABEL QUALITY_DEFECT_NAME, COUNT(*) SUM
|
|
|
|
|
FROM REPORT_QUALITY_INSPECTION QI
|
|
|
|
|
LEFT JOIN BASE_QUALITY_INSPECTION_ITEM QII ON QII.QUALITY_DEFECT_CODE = QI.QUALITY_DEFECT_CODE
|
|
|
|
|
left join SYS_DICT_DATA xl
|
|
|
|
|
on xl.DICT_TYPE = 'defect_subclass' and QII.MATERIAL_SUBCLASS = xl.DICT_VALUE
|
|
|
|
|
WHERE QI.QUALITY_DEFECT_NAME IS NOT NULL
|
|
|
|
|
AND TO_CHAR(INSPECTOR_TIME, 'YYYY-MM-DD') IN
|
|
|
|
|
(SELECT TO_CHAR(TRUNC(SYSDATE, 'IW') + LEVEL - 1, 'YYYY-MM-DD') AS day_of_week
|
|
|
|
|
FROM DUAL
|
|
|
|
|
CONNECT BY LEVEL <= 7)
|
|
|
|
|
GROUP BY xl.DICT_LABEL
|
|
|
|
|
ORDER BY SUM DESC
|
|
|
|
|
)
|
|
|
|
|
WHERE ROWNUM <= 5
|
|
|
|
|
WHERE ROWNUM <= 10
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="boxFoamingProductionInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
|
|
|
@ -145,4 +162,10 @@
|
|
|
|
|
FROM VIEW_CURRENT_TEAM_TIME
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="todayOfflineProduction" resultType="java.util.HashMap">
|
|
|
|
|
SELECT COUNT(*) OFFLINE_SUM
|
|
|
|
|
FROM C##AUCMA_SCADA.PRODUCT_OFFLINE
|
|
|
|
|
WHERE TO_CHAR(PRODUCT_SCANTIME, 'YYYY-MM-DD') = TO_CHAR(SYSDATE, 'YYYY-MM-DD')
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|