diff --git a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml index f47f857..5435ab8 100644 --- a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml @@ -24,10 +24,29 @@ and process_code = 1002 and delete_flag = '0' -- and to_char(plan_date, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd') - and CREATION_DATE between - to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', 'yyyy-MM-dd hh24:mi:ss') - and - to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss') + and + CREATION_DATE > + case + when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date( + to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', + 'yyyy-MM-dd hh24:mi:ss') + when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', + 'yyyy-MM-dd hh24:mi:ss') + else to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss') + end + and CREATION_DATE < + case + when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date( + to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', + 'yyyy-MM-dd hh24:mi:ss') + when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', + 'yyyy-MM-dd hh24:mi:ss') + else to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '24:00:00', 'yyyy-MM-dd hh24:mi:ss') + end +-- CREATION_DATE between +-- to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', 'yyyy-MM-dd hh24:mi:ss') +-- and +-- to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss') group by to_char(plan_date, 'yyyy-MM-dd') @@ -74,11 +93,24 @@ SUM(ACTUAL_QTY) as qty from IMOS_PR_PLAN where --- to_char(plan_date, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd') - CREATION_DATE between - to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', 'yyyy-MM-dd hh24:mi:ss') - and - to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss') + CREATION_DATE > + case + when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date( + to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', + 'yyyy-MM-dd hh24:mi:ss') + when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', + 'yyyy-MM-dd hh24:mi:ss') + else to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss') + end + and CREATION_DATE < + case + when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date( + to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', + 'yyyy-MM-dd hh24:mi:ss') + when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', + 'yyyy-MM-dd hh24:mi:ss') + else to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '24:00:00', 'yyyy-MM-dd hh24:mi:ss') + end and PROCESS_CODE = 1002 and ACTUAL_QTY!=0 group by MATERIAL_NAME @@ -120,11 +152,28 @@ from IMOS_LO_TASK_HISTORY where detial_type_code = '1002' and TASK_TYPE != 'O' - - and CREATION_DATE between - to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', 'yyyy-MM-dd hh24:mi:ss') - and - to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss') + and CREATION_DATE > + case + when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date( + to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', + 'yyyy-MM-dd hh24:mi:ss') + when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', + 'yyyy-MM-dd hh24:mi:ss') + else to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss') + end + and CREATION_DATE < + case + when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date( + to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', + 'yyyy-MM-dd hh24:mi:ss') + when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', + 'yyyy-MM-dd hh24:mi:ss') + else to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '24:00:00', 'yyyy-MM-dd hh24:mi:ss') + end +-- and CREATION_DATE between +-- to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00', 'yyyy-MM-dd hh24:mi:ss') +-- and +-- to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss') ) group by TO_CHAR(CREATION_DATE, 'hh24') order by name