|
|
|
|
@ -13,16 +13,9 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectplanCompletion" resultType="com.ruoyi.system.domain.BoxPlanCompletion">
|
|
|
|
|
select
|
|
|
|
|
-- (SELECT *
|
|
|
|
|
-- FROM (select PLAN_NUMBER
|
|
|
|
|
-- from haiwei.BASE_BOX_PLAN
|
|
|
|
|
-- where rownum = 1
|
|
|
|
|
-- ORDER BY CREATE_TIME DESC)) AS planned_number,
|
|
|
|
|
(SELECT *
|
|
|
|
|
FROM (select PLAN_NUMBER
|
|
|
|
|
from haiwei.BASE_BOX_PLAN
|
|
|
|
|
where rownum = 1
|
|
|
|
|
ORDER BY CREATE_TIME DESC)) AS planned_number,
|
|
|
|
|
( select sum(PLAN_QTY) qty
|
|
|
|
|
from imos_ta_material
|
|
|
|
|
where DISPLAY_FLAG = 1) AS planned_number,
|
|
|
|
|
nvl(sum(actual_qty), 0) AS quantity_number
|
|
|
|
|
|
|
|
|
|
from IMOS_PR_PLAN
|
|
|
|
|
@ -540,7 +533,7 @@ where DAY between (TRUNC(sysdate, 'D') + 1) and (TRUNC(sysdate, 'D') + 7)
|
|
|
|
|
|
|
|
|
|
<select id="zz_selectLossInfo" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM) / 60, 2)-
|
|
|
|
|
-nvl(case
|
|
|
|
|
nvl(case
|
|
|
|
|
when sysdate > to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
then
|
|
|
|
|
case
|
|
|
|
|
@ -556,8 +549,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
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 < = wb.W_END then W_START else W_END end
|
|
|
|
|
and case when sysdate < = wb.W_END then W_END else B_END end
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_START
|
|
|
|
|
when #{state} = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_END
|
|
|
|
|
when #{state} = 2 then B_END end
|
|
|
|
|
and DETIAL_TYPE_CODE = '1004') t1
|
|
|
|
|
left join
|
|
|
|
|
(select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
@ -567,8 +566,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
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 < = wb.W_END then W_START else W_END end
|
|
|
|
|
and case when sysdate < = wb.W_END then W_END else B_END end
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_START
|
|
|
|
|
when #{state} = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_END
|
|
|
|
|
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
|
|
|
|
|
@ -587,8 +592,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
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 < = wb.W_END then W_START else W_END end
|
|
|
|
|
and case when sysdate < = wb.W_END then W_END else B_END end
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_START
|
|
|
|
|
when #{state} = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_END
|
|
|
|
|
when #{state} = 2 then B_END end
|
|
|
|
|
and DETIAL_TYPE_CODE = '1004') t1
|
|
|
|
|
left join
|
|
|
|
|
(select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
@ -598,8 +609,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
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 < = wb.W_END then W_START else W_END end
|
|
|
|
|
and case when sysdate < = wb.W_END then W_END else B_END end
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_START
|
|
|
|
|
when #{state} = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_END
|
|
|
|
|
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
|
|
|
|
|
@ -616,8 +633,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
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 < = wb.W_END then W_START else W_END end
|
|
|
|
|
and case when sysdate < = wb.W_END then W_END else B_END end
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_START
|
|
|
|
|
when #{state} = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_END
|
|
|
|
|
when #{state} = 2 then B_END end
|
|
|
|
|
and DETIAL_TYPE_CODE = '1004') t1
|
|
|
|
|
left join
|
|
|
|
|
(select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
@ -627,8 +650,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
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 < = wb.W_END then W_START else W_END end
|
|
|
|
|
and case when sysdate < = wb.W_END then W_END else B_END end
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_START
|
|
|
|
|
when #{state} = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_END
|
|
|
|
|
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
|
|
|
|
|
@ -638,6 +667,10 @@ where 180 < ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select
|
|
|
|
|
case when qty < 0 then 0 else qty end as qty,name
|
|
|
|
|
from
|
|
|
|
|
(
|
|
|
|
|
select count(1)-nvl(case
|
|
|
|
|
when sysdate > to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
then
|
|
|
|
|
@ -654,8 +687,14 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
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 < = wb.W_END then W_START else W_END end
|
|
|
|
|
and case when sysdate < = wb.W_END then W_END else B_END end
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_START
|
|
|
|
|
when #{state} = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_END
|
|
|
|
|
when #{state} = 2 then B_END end
|
|
|
|
|
and DETIAL_TYPE_CODE = '1004') t1
|
|
|
|
|
left join
|
|
|
|
|
(select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
@ -665,13 +704,20 @@ from (select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
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 < = wb.W_END then W_START else W_END end
|
|
|
|
|
and case when sysdate < = wb.W_END then W_END else B_END end
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_START
|
|
|
|
|
when #{state} = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_END
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
where 600 < ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
|
|
|
|
|
)
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="mtk_selectInStore3d" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
@ -770,78 +816,220 @@ where 600 < ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
|
|
|
|
|
group by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
order by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
</select>
|
|
|
|
|
<select id="zz_selectProductInByTeamNight" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select name,qty
|
|
|
|
|
from (
|
|
|
|
|
select '19:30' as name, nvl(count(1), 0) as qty,1 as ord
|
|
|
|
|
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)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
union
|
|
|
|
|
select '20:30' as name, nvl(count(1), 0) as qty,2 as ord
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE 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 DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
union
|
|
|
|
|
select '21:30' as name, nvl(count(1), 0) as qty,3 as ord
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE 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 DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
union
|
|
|
|
|
select '22:30' as name, nvl(count(1), 0) as qty,4 as ord
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE 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 DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
union
|
|
|
|
|
select '23:30' as name, nvl(count(1), 0) as qty,5 as ord
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE 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 DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '00:30' as name, nvl(count(1), 0) as qty,6 as ord
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE 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 DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '01:30' as name, nvl(count(1), 0) as qty,7 as ord
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE 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 DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select '02:30' as name, nvl(count(1), 0) as qty,8 as ord
|
|
|
|
|
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)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
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)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
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)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
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)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
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)
|
|
|
|
|
where qt = 1
|
|
|
|
|
) t1 on 1 = 1
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between day1 and day2
|
|
|
|
|
)
|
|
|
|
|
order by ord
|
|
|
|
|
</select>
|
|
|
|
|
<select id="zz_selectProductInByTeam" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select '07:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME 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') || '08:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '08:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '08:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '09:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '10:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '11:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '11:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '11:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '12:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '12:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '12:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '13:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '13:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '13:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '14:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '15:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '16:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '16:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '16:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '17:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '17:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '17:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '18:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '18:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '18: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')
|
|
|
|
|
select '07:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME 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') || '08:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '08:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '08:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '09:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '10:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '11:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '11:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '11:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '12:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '12:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '12:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '13:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '13:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '13:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '14:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '14:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '15:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '16:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '16:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '16:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '17:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '17:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '17:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '18:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
union
|
|
|
|
|
select '18:30' as name, nvl(count(1),0) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
and SCAN_TIME between to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '18: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')
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -864,7 +1052,11 @@ where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
order by name
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectOneBadRate" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select nvl(qty1,0) as qty,
|
|
|
|
|
select sum(qty) as qty,
|
|
|
|
|
name,
|
|
|
|
|
sum (rate) as rate
|
|
|
|
|
from
|
|
|
|
|
(select nvl(qty1,0) as qty,
|
|
|
|
|
name,
|
|
|
|
|
nvl(round((qty1/a.qty)*100,2),0) as rate
|
|
|
|
|
from (
|
|
|
|
|
@ -872,8 +1064,17 @@ where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
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
|
|
|
|
|
on 1 = 1
|
|
|
|
|
where ippb.PRODUCTION_DATE between case when sysdate < = wb.W_END then W_START else W_END end
|
|
|
|
|
and case when sysdate < = wb.W_END then W_END else B_END end
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_START
|
|
|
|
|
when #{state} = 2 then W_END
|
|
|
|
|
end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when #{state} = 1 then W_END
|
|
|
|
|
when #{state} = 2 then B_END
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
and DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
group by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
order by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
@ -883,6 +1084,13 @@ where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
where ITEM_CODE = '1006'
|
|
|
|
|
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
|
|
|
|
|
when #{state} = 1 then '07:30'
|
|
|
|
|
when #{state} = 2 then '19:30'
|
|
|
|
|
end as name ,0 as rate from dual
|
|
|
|
|
)
|
|
|
|
|
group by name
|
|
|
|
|
order by name
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
@ -1053,7 +1261,16 @@ where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
<select id="zz_countNightProductIn" resultType="integer">
|
|
|
|
|
select count(1)
|
|
|
|
|
from IMOS.IMOS_PR_PRODUCT_BARCODE
|
|
|
|
|
where PRODUCTION_DATE > (
|
|
|
|
|
select W_END + interval '5' MINUTE
|
|
|
|
|
from (select * from haiwei.BASE_DAY_WBTIME order by CREATE_TIME desc )
|
|
|
|
|
where ROWNUM = 1
|
|
|
|
|
)
|
|
|
|
|
and ROWNUM < 10
|
|
|
|
|
</select>
|
|
|
|
|
<select id="mtk_selectQAZD" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select round((CASE
|
|
|
|
|
WHEN Sum_Value = 0 THEN 0.00
|
|
|
|
|
@ -1095,7 +1312,7 @@ where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
|
|
|
|
|
<resultMap id="MTKBeen" type="com.ruoyi.system.domain.MTKBeen">
|
|
|
|
|
<result column="code" property="code"/>
|
|
|
|
|
<collection property="list" javaType="java.util.List" resultMap="BoxOutputBeen" />
|
|
|
|
|
<collection property="list" javaType="java.util.List" resultMap="BoxOutputBeen"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<resultMap id="BoxOutputBeen" type="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
<result column="name" property="name"/>
|
|
|
|
|
@ -1181,7 +1398,7 @@ where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="yue_selectProductInStore" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
<select id="yue_selectProductInStore" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select to_number(to_char(PRODUCTION_DATE, 'MM')) as name, count(1) as qty
|
|
|
|
|
from IMOS.IMOS_PR_PRODUCT_BARCODE
|
|
|
|
|
where PRODUCTION_DATE > TRUNC(sysdate, 'YYYY')
|
|
|
|
|
|