|
|
|
|
@ -11,42 +11,20 @@
|
|
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="selectplanCompletion" resultType="com.ruoyi.system.domain.BoxPlanCompletion">
|
|
|
|
|
select
|
|
|
|
|
( select sum(PLAN_QTY) qty
|
|
|
|
|
<select id="selectplanCompletion" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select sum(PLAN_QTY) qty, '计划数量' as name
|
|
|
|
|
from imos_ta_material
|
|
|
|
|
where DISPLAY_FLAG = 1) AS planned_number,
|
|
|
|
|
nvl(sum(actual_qty), 0) AS quantity_number
|
|
|
|
|
|
|
|
|
|
from IMOS_PR_PLAN
|
|
|
|
|
where plan_date is not null
|
|
|
|
|
and process_code = 1002
|
|
|
|
|
and delete_flag = '0'
|
|
|
|
|
-- and to_char(plan_date, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
|
|
|
|
|
and
|
|
|
|
|
to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') >
|
|
|
|
|
case
|
|
|
|
|
when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date(
|
|
|
|
|
to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
|
|
|
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00',
|
|
|
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
else to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
end
|
|
|
|
|
and to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') <
|
|
|
|
|
case
|
|
|
|
|
when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date(
|
|
|
|
|
to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00',
|
|
|
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
|
|
|
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
else to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '24:00:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
end
|
|
|
|
|
-- CREATION_DATE 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') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
group by to_char(plan_date, 'yyyy-MM-dd')
|
|
|
|
|
where DISPLAY_FLAG = 1
|
|
|
|
|
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
|
|
|
|
|
on 1 = 1
|
|
|
|
|
where xhq.CREATE_TIME 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 QTY3 > 0
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectStock" resultType="com.ruoyi.system.domain.BoxStock">
|
|
|
|
|
@ -75,44 +53,28 @@ to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') >
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectOutputByType" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select substr(MATERIAL_NAME,
|
|
|
|
|
case
|
|
|
|
|
when instr(MATERIAL_NAME, '/', 1, 1) = 0 then instr(MATERIAL_NAME, ',', 1, 1) + 1
|
|
|
|
|
else instr(MATERIAL_NAME, '/', 1, 1) + 1
|
|
|
|
|
end,
|
|
|
|
|
case
|
|
|
|
|
when instr(MATERIAL_NAME, ',', 1, 2) = 0 then Length(MATERIAL_NAME) + 1
|
|
|
|
|
else instr(MATERIAL_NAME, ',', 1, 2)
|
|
|
|
|
end
|
|
|
|
|
-
|
|
|
|
|
case
|
|
|
|
|
when instr(MATERIAL_NAME, '/', 1, 1) = 0 then instr(MATERIAL_NAME, ',', 1, 1) + 1
|
|
|
|
|
else instr(MATERIAL_NAME, '/', 1, 1) + 1
|
|
|
|
|
end) as name,
|
|
|
|
|
SUM(ACTUAL_QTY) as qty
|
|
|
|
|
from IMOS_PR_PLAN
|
|
|
|
|
where
|
|
|
|
|
to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') >
|
|
|
|
|
case
|
|
|
|
|
when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date(
|
|
|
|
|
to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
|
|
|
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00',
|
|
|
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
else to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
end
|
|
|
|
|
and to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') <
|
|
|
|
|
case
|
|
|
|
|
when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date(
|
|
|
|
|
to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00',
|
|
|
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
|
|
|
|
|
'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
else to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '24:00:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
end
|
|
|
|
|
and PROCESS_CODE = 1002
|
|
|
|
|
and ACTUAL_QTY!=0
|
|
|
|
|
group by MATERIAL_NAME
|
|
|
|
|
select substr(name,
|
|
|
|
|
case
|
|
|
|
|
when instr(name, '/', 1, 1) = 0 then instr(name, ',', 1, 1) + 1
|
|
|
|
|
else instr(name, '/', 1, 1) + 1
|
|
|
|
|
end,
|
|
|
|
|
case
|
|
|
|
|
when instr(name, ',', 1, 2) = 0 then Length(name) + 1
|
|
|
|
|
else instr(name, ',', 1, 2)
|
|
|
|
|
end
|
|
|
|
|
-
|
|
|
|
|
case
|
|
|
|
|
when instr(name, '/', 1, 1) = 0 then instr(name, ',', 1, 1) + 1
|
|
|
|
|
else instr(name, '/', 1, 1) + 1
|
|
|
|
|
end) as name,
|
|
|
|
|
sum(QTY3)
|
|
|
|
|
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
|
|
|
|
|
on 1 = 1
|
|
|
|
|
where xhq.CREATE_TIME 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 QTY3 > 0
|
|
|
|
|
group by name
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="xk_selectStockOccupancy" resultType="com.ruoyi.system.domain.OrderInfo">
|
|
|
|
|
@ -154,33 +116,6 @@ to_date(START_TIME, 'yyyy-MM-dd hh24:mi:ss') >
|
|
|
|
|
where xhq.CREATE_TIME 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
|
|
|
|
|
order by xhq.CREATE_TIME
|
|
|
|
|
-- select TO_CHAR(CREATION_DATE, 'hh24') || ':30' as name, Count(TASK_ID) as qty
|
|
|
|
|
-- from (
|
|
|
|
|
-- select CREATION_DATE, TASK_ID
|
|
|
|
|
-- from IMOS_LO_TASK_HISTORY
|
|
|
|
|
-- where detial_type_code = '1002'
|
|
|
|
|
-- and TASK_TYPE != 'O'
|
|
|
|
|
-- and CREATION_DATE >
|
|
|
|
|
-- case
|
|
|
|
|
-- when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date(
|
|
|
|
|
-- to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
|
|
|
|
|
-- 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
-- when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00',
|
|
|
|
|
-- 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
-- else to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '19:30:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
-- end
|
|
|
|
|
-- and CREATION_DATE <
|
|
|
|
|
-- case
|
|
|
|
|
-- when to_char(sysdate, 'hh24') > 7 and to_char(sysdate, 'hh24') < 20 then to_date(
|
|
|
|
|
-- to_char(SYSDATE, 'yyyy-MM-dd') || '19:30:00',
|
|
|
|
|
-- 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
-- when to_char(sysdate, 'hh24') < 7 then to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '07:30:00',
|
|
|
|
|
-- 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
-- else to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '24:00:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
-- end
|
|
|
|
|
-- )
|
|
|
|
|
-- group by TO_CHAR(CREATION_DATE, 'hh24')
|
|
|
|
|
-- order by name
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|