|
|
|
|
@ -110,6 +110,154 @@
|
|
|
|
|
group by TO_CHAR(CREATION_DATE, 'hh24')
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectOutputByTime1" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select name, qty
|
|
|
|
|
from (
|
|
|
|
|
select '19:30' as name, sum(QTY3) as qty,1 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
select W_END as day1, W_END + interval '1' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >= day1 and ippb.CREATE_TIME < day2
|
|
|
|
|
union
|
|
|
|
|
select '20:30' as name, sum(QTY3) as qty, 2 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
-- 2022-07-28 20:30:00
|
|
|
|
|
select W_END + interval '1' HOUR as day1, W_END + interval '2' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
union
|
|
|
|
|
select '21:30' as name, sum(QTY3) as qty, 3 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
-- 2022-07-28 21:30:00
|
|
|
|
|
select W_END + interval '2' HOUR as day1, W_END + interval '3' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
union
|
|
|
|
|
select '22:30' as name, sum(QTY3) as qty, 4 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
-- 2022-07-28 22:30:00
|
|
|
|
|
select W_END + interval '3' HOUR as day1, W_END + interval '4' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
union
|
|
|
|
|
select '23:30' as name, sum(QTY3) as qty, 5 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
-- 2022-07-28 23:30:00
|
|
|
|
|
select W_END + interval '4' HOUR as day1, W_END + interval '5' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '00:30' as name, sum(QTY3) as qty, 6 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
-- 2022-07-29 00:30:00
|
|
|
|
|
select W_END + interval '5' HOUR as day1, W_END + interval '6' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '01:30' as name, sum(QTY3) as qty, 7 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
-- 2022-07-29 01:30:00
|
|
|
|
|
select W_END + interval '6' HOUR as day1, W_END + interval '7' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '02:30' as name, sum(QTY3) as qty, 8 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
select W_END + interval '7' HOUR as day1, W_END + interval '8' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '03:30' as name, sum(QTY3) as qty, 9 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
select W_END + interval '8' HOUR as day1, W_END + interval '9' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '04:30' as name, sum(QTY3) as qty, 10 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
select W_END + interval '9' HOUR as day1, W_END + interval '10' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '05:30' as name, sum(QTY3) as qty, 11 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
select W_END + interval '10' HOUR as day1, W_END + interval '11' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '06:30' as name, sum(QTY3) as qty, 12 as ord
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD ippb
|
|
|
|
|
left join (
|
|
|
|
|
select W_END + interval '11' HOUR as day1, W_END + interval '12' HOUR as day2
|
|
|
|
|
from (select W_END, row_number() over (order by CREATE_TIME desc) as qt from haiwei.BASE_DAY_WBTIME)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where ippb.CREATE_TIME >
|
|
|
|
|
= day1 and ippb.CREATE_TIME <
|
|
|
|
|
day2
|
|
|
|
|
)
|
|
|
|
|
order by ord
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectOutputByTime" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select '07:30' as name, nvl(sum(QTY3),0) as qty
|
|
|
|
|
from IMOS.BASE_BOX_OUTPUT_RECORD
|
|
|
|
|
|