|
|
|
|
@ -408,7 +408,7 @@ FROM (select PLAN_NUMBER
|
|
|
|
|
order by to_number(STATION_NO)
|
|
|
|
|
</select>
|
|
|
|
|
<insert id="deleteTimp1">
|
|
|
|
|
delete from haiwei.temp1
|
|
|
|
|
TRUNCATE TABLE temp1
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertTimp1">
|
|
|
|
|
insert into haiwei.temp1 (
|
|
|
|
|
@ -424,45 +424,141 @@ FROM (select PLAN_NUMBER
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<select id="zz_selectLossInfo" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select case
|
|
|
|
|
when sysdate > to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '10:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
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') || '15:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
then qty - 60
|
|
|
|
|
else qty - 30 end
|
|
|
|
|
end as qty ,name
|
|
|
|
|
from (
|
|
|
|
|
select ROUND(sum(ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy) / 60, 2) as qty, 1 as name
|
|
|
|
|
from temp1 t1
|
|
|
|
|
left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 1
|
|
|
|
|
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy > 0)
|
|
|
|
|
union
|
|
|
|
|
select count(1) as qty, 2 as name
|
|
|
|
|
from temp1 t1
|
|
|
|
|
left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 2
|
|
|
|
|
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy > 0
|
|
|
|
|
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy <= 180
|
|
|
|
|
union
|
|
|
|
|
select count(1) as qty, 3 as name
|
|
|
|
|
from temp1 t1
|
|
|
|
|
left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 2
|
|
|
|
|
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy > 180
|
|
|
|
|
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy <= 600
|
|
|
|
|
union
|
|
|
|
|
select 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 qty - 2
|
|
|
|
|
else qty - 1 end
|
|
|
|
|
end,0) as qty,name
|
|
|
|
|
from (
|
|
|
|
|
select nvl(count(1),0) as qty, 4 as name
|
|
|
|
|
from temp1 t1
|
|
|
|
|
left join TEMP1 t2 on t1.row_numbre = t2.row_numbre + 2
|
|
|
|
|
where ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t1.rhy > 600)
|
|
|
|
|
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
|
|
|
|
|
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 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
|
|
|
|
|
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 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
|
|
|
|
|
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
|
|
|
|
|
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 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
|
|
|
|
|
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 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
|
|
|
|
|
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
|
|
|
|
|
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM < = 180
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
select count(1) as qty,
|
|
|
|
|
3 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 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
|
|
|
|
|
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 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
|
|
|
|
|
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 180 < ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM
|
|
|
|
|
and ROUND(TO_NUMBER(t1.day - t2.day) * 24 * 60 * 60) - t3.RHYTHM < = 600
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
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
|
|
|
|
|
case
|
|
|
|
|
when sysdate > 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
|
|
|
|
|
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 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
|
|
|
|
|
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 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
|
|
|
|
|
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">
|
|
|
|
|
@ -491,8 +587,8 @@ from (
|
|
|
|
|
select (
|
|
|
|
|
case when
|
|
|
|
|
TO_CHAR(SYSDATE, 'hh24')-1 < 0
|
|
|
|
|
then '23' else TO_CHAR(SYSDATE, 'hh24')-1 end
|
|
|
|
|
|| ':30') as name,
|
|
|
|
|
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
|
|
|
|
|
|