From 6ced60837995bdf507ac64603ca72bf0e670d642 Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Mon, 25 Jul 2022 14:48:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=80=BB=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/system/BroadDataMapper.xml | 82 ++++++++++++++++--- 1 file changed, 69 insertions(+), 13 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml index 4594af2..0c8cb68 100644 --- a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml @@ -849,20 +849,76 @@ where DETIAL_TYPE_CODE = '1004' + where to_char(FINISH_DATE,'yyyy-MM-dd') = + ( + select to_char(DAY, 'yyyy-MM-dd') + from ( + select DAY,ROWNUM as qt + from haiwei.BASE_PRODUCT_QTY + where DAY < to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss') + order by DAY desc) + where qt =3) + union + select substr(ORDER_NO, 5, length(ORDER_NO)) || '(' || substr( + substr(MATERIAL_NAME, + instr(MATERIAL_NAME, '-', 1, 1) + 1, + length(MATERIAL_NAME)), + 0, + instr( + substr(MATERIAL_NAME, + instr(MATERIAL_NAME, '-', 1, 1) + 1, + length(MATERIAL_NAME)), ',', 1, 1) - 1) || ')' as name + , + round(ACTUAL_QTY / ORDER_QTY * 100, 2) as rate, + case when round(ACTUAL_QTY / ORDER_QTY * 100, 2) < 100 then 3 else 0 end as qty + from IMOS_PR_ORDER + where to_char(FINISH_DATE,'yyyy-MM-dd') = + ( + select to_char(DAY, 'yyyy-MM-dd') + from ( + select DAY,ROWNUM as qt + from haiwei.BASE_PRODUCT_QTY + where DAY < to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss') + order by DAY desc) + where qt =2) + union + select substr(ORDER_NO, 5, length(ORDER_NO)) || '(' || substr( + substr(MATERIAL_NAME, + instr(MATERIAL_NAME, '-', 1, 1) + 1, + length(MATERIAL_NAME)), + 0, + instr( + substr(MATERIAL_NAME, + instr(MATERIAL_NAME, '-', 1, 1) + 1, + length(MATERIAL_NAME)), ',', 1, 1) - 1) || ')' as name + , + round(ACTUAL_QTY / ORDER_QTY * 100, 2) as rate, + case when round(ACTUAL_QTY / ORDER_QTY * 100, 2) < 100 then 1 else 0 end as qty + from IMOS_PR_ORDER + where to_char(FINISH_DATE,'yyyy-MM-dd') = + ( + select to_char(DAY, 'yyyy-MM-dd') + from ( + select DAY,ROWNUM as qt + from haiwei.BASE_PRODUCT_QTY + where DAY < to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss') + order by DAY desc) + where qt =1) + + +