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) + + +