Merge remote-tracking branch 'origin/master'

master
夜笙歌 3 years ago
commit 71b9f4ea17

@ -12,10 +12,14 @@
</resultMap>
<delete id="deleteWorkTime">
delete from HAIWEI.BASE_DAY_WBTIME where CREATE_TIME &lt; sysdate - interval '15' DAY
delete
from HAIWEI.BASE_DAY_WBTIME
where CREATE_TIME &lt; sysdate - interval '15' DAY
</delete>
<delete id="deleteBoxOutput">
delete from IMOS.BASE_BOX_OUTPUT_RECORD where CREATE_TIME &lt; sysdate - interval '10' DAY
delete
from IMOS.BASE_BOX_OUTPUT_RECORD
where CREATE_TIME &lt; sysdate - interval '10' DAY
</delete>
<select id="selectplanCompletion" resultType="com.ruoyi.system.domain.BoxOutput">
@ -25,7 +29,9 @@
union
select sum(QTY3) as qty, '实际产量' as name
from IMOS.BASE_BOX_OUTPUT_RECORD xhq
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where xhq.CREATE_TIME between
case when sysdate &lt;= wb.W_END then W_START else W_END end
@ -76,7 +82,9 @@
end) as name,
sum(QTY3) as qty
from IMOS.BASE_BOX_OUTPUT_RECORD xhq
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where xhq.CREATE_TIME between case when sysdate &lt;= wb.W_END then W_START else W_END end
and case when sysdate &lt;= wb.W_END then W_END else B_END end
@ -124,21 +132,25 @@
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)
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 &gt;= day1 and ippb.CREATE_TIME &lt; day2
where ippb.CREATE_TIME &gt;= day1
and ippb.CREATE_TIME &lt; 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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
select '21:30' as name, sum(QTY3) as qty, 3 as ord
@ -146,11 +158,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
select '22:30' as name, sum(QTY3) as qty, 4 as ord
@ -158,11 +172,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
select '23:30' as name, sum(QTY3) as qty, 5 as ord
@ -170,11 +186,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
@ -183,11 +201,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
@ -196,11 +216,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
@ -208,11 +230,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
@ -220,11 +244,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
@ -232,11 +258,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
@ -244,11 +272,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
union
@ -256,11 +286,13 @@
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)
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 &gt;
= day1 and ippb.CREATE_TIME &lt;
= day1
and ippb.CREATE_TIME &lt;
day2
)
order by ord
@ -422,7 +454,8 @@
end) as name,
STATION_NO,
(select QTY
from (select QTY, row_number() over (order by CREATE_TIME desc) row_n from HAIWEI.BASE_FP_PLANQTY)
from (select QTY, row_number() over (order by CREATE_TIME desc) row_n
from HAIWEI.BASE_FP_PLANQTY)
where row_n = 1) as target,
case
when PRODUCT_STATUS = 0 then '未生产'
@ -629,7 +662,6 @@
select count(1) as qty, '订单数量' as name
from IMOS_PR_ORDER
where to_char(FINISH_DATE, 'yyyy-MM-dd') in (
select to_char(DAY, 'yyyy-MM-dd')
from haiwei.BASE_PRODUCT_QTY
where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7))
@ -637,7 +669,6 @@
select count(1) as qty, '完成数量' as name
from IMOS_PR_ORDER
where to_char(FINISH_DATE, 'yyyy-MM-dd') in (
select to_char(DAY, 'yyyy-MM-dd')
from haiwei.BASE_PRODUCT_QTY
where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7))
@ -648,7 +679,6 @@
select count(1)
from IMOS_PR_ORDER
where to_char(FINISH_DATE, 'yyyy-MM-dd') in (
select to_char(DAY, 'yyyy-MM-dd')
from haiwei.BASE_PRODUCT_QTY
where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7))
@ -661,7 +691,8 @@
select to_char(DAY, 'yyyy-MM-dd')
from haiwei.BASE_PRODUCT_QTY
where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7))
) * 100, 2) as qty, '清单率' as name
) * 100, 2) as qty,
'清单率' as name
from DUAL
-- union
-- select count(1)as qty, '入库订单统计' as name
@ -709,7 +740,8 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
left join haiwei.BASE_DAY_WBTIME wb
on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 1)
) wb on 1 = 1
where PRODUCTION_DATE between W_START and B_END
@ -719,7 +751,8 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
left join haiwei.BASE_DAY_WBTIME wb
on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 2)
) wb on 1 = 1
where PRODUCTION_DATE between W_START and B_END
@ -729,7 +762,8 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
left join haiwei.BASE_DAY_WBTIME wb
on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 3)
) wb on 1 = 1
where PRODUCTION_DATE between W_START and B_END
@ -739,7 +773,8 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
left join haiwei.BASE_DAY_WBTIME wb
on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 4)
) wb on 1 = 1
where PRODUCTION_DATE between W_START and B_END
@ -749,7 +784,8 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
left join haiwei.BASE_DAY_WBTIME wb
on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 5)
) wb on 1 = 1
where PRODUCTION_DATE between W_START and B_END
@ -759,7 +795,8 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
left join haiwei.BASE_DAY_WBTIME wb
on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 6)
) wb on 1 = 1
where PRODUCTION_DATE between W_START and B_END
@ -769,14 +806,14 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
from IMOS.IMOS_PR_PRODUCT_BARCODE ba
left join (select to_char(bpq.DAY, 'MM-dd') as day, W_START, B_END
from haiwei.BASE_PRODUCT_QTY bpq
left join haiwei.BASE_DAY_WBTIME wb on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
left join haiwei.BASE_DAY_WBTIME wb
on to_char(bpq.DAY, 'yyyy-MM-dd') = wb.CREATE_DAY
where DAY = (TRUNC(sysdate, 'D') + 7)
) wb on 1 = 1
where PRODUCTION_DATE between W_START and B_END
group by wb.day
</select>
<select id="zhou_selectQaInfo" resultType="com.ruoyi.system.domain.BoxOutput">
@ -843,8 +880,27 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
(
select to_char(DAY, 'yyyy-MM-dd')
from haiwei.BASE_PRODUCT_QTY
where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
where DAY between
case
when
to_char(TRUNC(sysdate, 'D'), 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
then
(TRUNC(sysdate, 'D') -6) else
(TRUNC(sysdate, 'D') + 1) end
and
case
when
to_char(TRUNC(sysdate, 'D'), 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
then
TRUNC(sysdate, 'D') else
(TRUNC(sysdate, 'D') + 7) end
)
order by FINISH_DATE
</select>
@ -947,9 +1003,11 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
PRODUCTION_DATE as day,
(select * from (select RHYTHM from haiwei.BASE_RHYTHM where ROWNUM = 1 order by ID desc)) as rhy
from IMOS.IMOS_PR_PRODUCT_BARCODE ippb
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb on 1 = 1
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between case when sysdate &lt;= wb.W_END then W_START else W_END end
and case when sysdate &lt; = wb.W_END then W_END else B_END end
and case when sysdate
&lt; = wb.W_END then W_END else B_END end
and DETIAL_TYPE_CODE = '1004'
)
</insert>
@ -960,8 +1018,10 @@ select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM) /
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
then
case
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
then 60 else 30 end
when sysdate &gt;
to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
then 60
else 30 end
end
, 0) as qty,
1 as name
@ -1004,7 +1064,6 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
where 0 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
union
select count(1) as qty,
2 as name
@ -1090,16 +1149,19 @@ where 180 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
union
select
case when qty &lt; 0 then 0 else qty end as qty,name
from
(
select case when qty &lt; 0 then 0 else qty end as qty,
name
from (
select count(1) - nvl(case
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00',
'yyyy-MM-dd hh24:mi:ss')
then
case
when sysdate &gt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
then 2 else 1 end
when sysdate &gt;
to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00',
'yyyy-MM-dd hh24:mi:ss')
then 2
else 1 end
end
, 0) as qty,
4 as name
@ -1137,7 +1199,8 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
when #{state} = 2 then B_END end
and DETIAL_TYPE_CODE = '1004') t2 on t1.row_number = t2.row_number + 1
left join
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3 on 1 = 1
(select * from (select RHYTHM from haiwei.BASE_RHYTHM order by ID desc) where ROWNUM = 1) t3
on 1 = 1
where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
)
@ -1150,7 +1213,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
instr(MATERIAL_NAME, '-', 1, 1) + 1,
instr(MATERIAL_NAME, ',', 1, 2) - 2 - instr(MATERIAL_NAME, '-', 1, 1) + 1) as name
from IMOS_PR_PRODUCT_BARCODE ippb
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.SCAN_TIME between
case
@ -1162,8 +1227,7 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
group by MATERIAL_NAME
</select>
<select id="mtk_selectInStore3d" resultType="com.ruoyi.system.domain.BoxOutput">
select
substr(MATERIAL_NAME,
select substr(MATERIAL_NAME,
case
when instr(MATERIAL_NAME, '-', 1, 1) = 0 then 1
else instr(MATERIAL_NAME, '-', 1, 1) + 1
@ -1185,13 +1249,17 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
<select id="selectNowXkOutPut" resultType="com.ruoyi.system.domain.BoxOutput">
select (
case when
case
when
TO_CHAR(SYSDATE, 'hh24') - 1 &lt; 0
then '23:30' else TO_CHAR(SYSDATE, 'hh24')-1 || ':30' end
then '23:30'
else TO_CHAR(SYSDATE, 'hh24') - 1 || ':30' end
) as name,
nvl(sum(actual_qty), 0) as qty
from IMOS.IMOS_PR_PLAN xhq
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb on 1 = 1
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb on 1 = 1
where to_date(xhq.START_TIME, 'yyyy-MM-dd hh24:mi:ss') between case when sysdate &lt;= wb.W_END then W_START else W_END end
and case when sysdate &lt;= wb.W_END then W_END else B_END end
and plan_date is not null
@ -1202,7 +1270,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
<select id="selectNowXkOutPut1" resultType="int">
select nvl(sum(actual_qty), 0)
from IMOS.IMOS_PR_PLAN ipp
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb on 1=1
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb on 1 = 1
where plan_date is not null
and process_code = 1002
and delete_flag = '0'
@ -1235,7 +1305,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
</select>
<select id="selectXK_H_QTY" resultType="int">
select * from ( select nvl(ZS_C, 0) from haiwei.XK_H_QTY order by CREATE_TIME desc) where ROWNUM=1
select *
from (select nvl(ZS_C, 0) from haiwei.XK_H_QTY order by CREATE_TIME desc)
where ROWNUM = 1
</select>
<insert id="insertXK_H_QTY">
@ -1264,7 +1336,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
from IMOS_PR_PRODUCT_BARCODE 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)
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 DETIAL_TYPE_CODE = '1004'
@ -1275,7 +1348,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
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)
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 DETIAL_TYPE_CODE = '1004'
@ -1286,7 +1360,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
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)
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 DETIAL_TYPE_CODE = '1004'
@ -1297,7 +1372,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
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)
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 DETIAL_TYPE_CODE = '1004'
@ -1308,7 +1384,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
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)
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 DETIAL_TYPE_CODE = '1004'
@ -1320,7 +1397,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
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)
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 DETIAL_TYPE_CODE = '1004'
@ -1332,7 +1410,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
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)
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 DETIAL_TYPE_CODE = '1004'
@ -1343,7 +1422,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
from IMOS_PR_PRODUCT_BARCODE 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)
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 DETIAL_TYPE_CODE = '1004'
@ -1353,9 +1433,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
select '03:30' as name, nvl(count(1), 0) as qty, 9 as ord
from IMOS_PR_PRODUCT_BARCODE 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)
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 DETIAL_TYPE_CODE = '1004'
@ -1365,9 +1445,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
select '04:30' as name, nvl(count(1), 0) as qty, 10 as ord
from IMOS_PR_PRODUCT_BARCODE 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)
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 DETIAL_TYPE_CODE = '1004'
@ -1377,9 +1457,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
select '05:30' as name, nvl(count(1), 0) as qty, 11 as ord
from IMOS_PR_PRODUCT_BARCODE 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)
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 DETIAL_TYPE_CODE = '1004'
@ -1389,9 +1469,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
select '06:30' as name, nvl(count(1), 0) as qty, 12 as ord
from IMOS_PR_PRODUCT_BARCODE 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)
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 DETIAL_TYPE_CODE = '1004'
@ -1496,14 +1576,15 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
select sum(qty) as qty,
name,
sum(rate) as rate
from
(select nvl(qty1,0) as qty,
from (select nvl(qty1, 0) as qty,
name,
nvl(round((qty1 / a.qty) * 100, 2), 0) as rate
from (
select to_char(PRODUCTION_DATE, 'hh24') || ':30' as name, count(1) as qty
from IMOS_PR_PRODUCT_BARCODE ippb
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where ippb.PRODUCTION_DATE between
case
@ -1526,10 +1607,13 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
and to_char(CREATION_DATE, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
group by to_char(CREATION_DATE, 'hh24')) on name = name1
union
select 0 as qty ,case
select 0 as qty,
case
when #{state} = 1 then '07:30'
when #{state} = 2 then '19:30'
end as name ,0 as rate from dual
end as name,
0 as rate
from dual
)
group by name
order by name
@ -1537,7 +1621,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
<select id="zz_selectInStoreTag" resultType="com.ruoyi.system.domain.BoxOutput">
select * from (select RHYTHM as qty, '节拍' as name from haiwei.BASE_RHYTHM where ROWNUM = 1 order by ID desc)
select *
from (select RHYTHM as qty, '节拍' as name from haiwei.BASE_RHYTHM where ROWNUM = 1 order by ID desc)
</select>
<select id="zz_selectProductInTarget" resultType="com.ruoyi.system.domain.BoxOutput">
-- select sum(QTY) as qty, '目标' as name
@ -1553,7 +1638,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
case when QTY_B = 0 then QTY else QTY_B end end as qty,
'进度目标' as name
from haiwei.BASE_PRODUCT_QTY bqty
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where to_char(DAY, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
union
@ -1567,7 +1654,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
else QTY_B
end as qty
from haiwei.BASE_PRODUCT_QTY bqty
left join (select * from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc) where ROWNUM = 1) wb
left join (select *
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc)
where ROWNUM = 1) wb
on 1 = 1
where to_char(DAY, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
@ -1587,7 +1676,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
ippi.CREATION_DATE as day
from IMOS_PR_PRODUCT_IN ippi
left join IMOS.IMOS_PR_ORDER po on ippi.ORDER_NO = po.ORDER_NO
where to_char(ippi.CREATION_DATE, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd') and ippi. DELETE_FLAG=0
where to_char(ippi.CREATION_DATE, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
and ippi.DELETE_FLAG = 0
</select>
<select id="mtk_selectOrderInfoBy3dTatle" resultType="com.ruoyi.system.domain.BoxOutput">
@ -1623,7 +1713,8 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
from (
select DAY, ROWNUM as qt
from haiwei.BASE_PRODUCT_QTY
where DAY &lt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss')
where DAY &lt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00',
'yyyy-MM-dd hh24:mi:ss')
order by DAY desc)
where qt &lt; 4)
and ORDER_QTY - ACTUAL_QTY &lt; 6
@ -1636,10 +1727,12 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
from (
select DAY, ROWNUM as qt
from haiwei.BASE_PRODUCT_QTY
where DAY &lt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss')
where DAY &lt; to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00',
'yyyy-MM-dd hh24:mi:ss')
order by DAY desc)
where qt &lt; 4)
) * 100, 2) as qty, '清单率' as name
) * 100, 2) as qty,
'清单率' as name
from DUAL
union
select count(1) as qty, '入库订单统计' as name
@ -1720,7 +1813,9 @@ where 600 &lt; ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
</select>
<select id="zz_selectOneBadRateMb" resultType="com.ruoyi.system.domain.BoxOutput">
select * from (select rate,'不合格率目标' from haiwei.BASE_ONE_UNQUQLIFIED_RATE order by CREATE_TIME desc) where ROWNUM=1
select *
from (select rate, '不合格率目标' from haiwei.BASE_ONE_UNQUQLIFIED_RATE order by CREATE_TIME desc)
where ROWNUM = 1
</select>
<select id="zz_countNightProductIn" resultType="integer">
select count(1)

Loading…
Cancel
Save