|
|
|
|
@ -1013,57 +1013,58 @@
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<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
|
|
|
|
|
when sysdate > to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
then
|
|
|
|
|
case
|
|
|
|
|
when sysdate >
|
|
|
|
|
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
|
|
|
|
|
select case when q1 < q2 then q1 else q1 - 12 end as qty, name
|
|
|
|
|
from (
|
|
|
|
|
select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM) / 60, 2) q1,
|
|
|
|
|
nvl(case
|
|
|
|
|
when sysdate > to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '09:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
then
|
|
|
|
|
case
|
|
|
|
|
when sysdate >
|
|
|
|
|
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 q2,
|
|
|
|
|
1 as name
|
|
|
|
|
from (select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
PRODUCTION_DATE as day
|
|
|
|
|
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
|
|
|
|
|
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,
|
|
|
|
|
PRODUCTION_DATE as day
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
PRODUCTION_DATE as day
|
|
|
|
|
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
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when 1 = 1 then W_START
|
|
|
|
|
when 1 = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when 1 = 1 then W_END
|
|
|
|
|
when 1 = 2 then B_END end
|
|
|
|
|
and DETIAL_TYPE_CODE = '1004') t1
|
|
|
|
|
left join
|
|
|
|
|
(select row_number() over (order by PRODUCTION_DATE) as row_number,
|
|
|
|
|
PRODUCTION_DATE as day
|
|
|
|
|
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
|
|
|
|
|
where ippb.PRODUCTION_DATE between
|
|
|
|
|
case
|
|
|
|
|
when 1 = 1 then W_START
|
|
|
|
|
when 1 = 2 then W_END end
|
|
|
|
|
and
|
|
|
|
|
case
|
|
|
|
|
when 1 = 1 then W_END
|
|
|
|
|
when 1 = 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 0 < ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
union
|
|
|
|
|
select count(1) as qty,
|
|
|
|
|
2 as name
|
|
|
|
|
|