|
|
|
@ -39,19 +39,34 @@
|
|
|
|
|
) SD
|
|
|
|
|
</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
|
|
|
|
|
SELECT PL.PRODUCT_LINE_CODE,
|
|
|
|
|
day_of_week BEGIN_DATE,
|
|
|
|
|
NVL(OFFLINE_SUM, 0) COMPLETE_AMOUNT,
|
|
|
|
|
ROUND(NVL(OFFLINE_SUM / ORDER_AMOUNT * 100, 0), 2) RATE
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT day_of_week, PRODUCT_LINE_CODE
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT TO_CHAR(TRUNC(SYSDATE, 'IW') + LEVEL - 1, 'YYYY-MM-DD') AS day_of_week
|
|
|
|
|
FROM DUAL
|
|
|
|
|
CONNECT BY LEVEL <= 7) WK
|
|
|
|
|
CROSS JOIN BASE_PRODUCTLINE
|
|
|
|
|
WHERE PRODUCT_LINE_TYPE = 1) PL
|
|
|
|
|
LEFT JOIN (SELECT PRODUCT_LINE_CODE,
|
|
|
|
|
TO_CHAR(PRODUCT_SCANTIME, 'YYYY-MM-DD') PRODUCT_SCANTIME,
|
|
|
|
|
COUNT(*) OFFLINE_SUM
|
|
|
|
|
FROM C##AUCMA_SCADA.PRODUCT_OFFLINE
|
|
|
|
|
GROUP BY PRODUCT_LINE_CODE, TO_CHAR(PRODUCT_SCANTIME, 'YYYY-MM-DD')) OL
|
|
|
|
|
ON PL.PRODUCT_LINE_CODE = OL.PRODUCT_LINE_CODE AND
|
|
|
|
|
PL.day_of_week = OL.PRODUCT_SCANTIME
|
|
|
|
|
LEFT JOIN (SELECT PL.PRODUCT_LINE_CODE,
|
|
|
|
|
TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BEGIN_DATE,
|
|
|
|
|
SUM(ORDER_AMOUNT) ORDER_AMOUNT
|
|
|
|
|
FROM BASE_ORDERINFO boi
|
|
|
|
|
JOIN BASE_MATERIALINFO bm ON bm.MATERIAL_CODE = boi.material_code AND bm.DISPO IN ('100')
|
|
|
|
|
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
|
|
|
|
|
JOIN BASE_PRODUCTLINE PL ON PL.WORK_CENTER_CODE = boi.WORK_CENTER_CODE
|
|
|
|
|
GROUP BY PL.PRODUCT_LINE_CODE, TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD')) OD
|
|
|
|
|
ON OD.PRODUCT_LINE_CODE = OL.PRODUCT_LINE_CODE AND PL.day_of_week = OD.BEGIN_DATE
|
|
|
|
|
ORDER BY PRODUCT_LINE_CODE,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,
|
|
|
|
|