|
|
|
|
@ -849,20 +849,76 @@ where DETIAL_TYPE_CODE = '1004'
|
|
|
|
|
</select>
|
|
|
|
|
<select id="mtk_selectOrderInfoBy3d" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select substr(ORDER_NO, 5, length(ORDER_NO)) || '(' || substr(
|
|
|
|
|
substr(MATERIAL_NAME,
|
|
|
|
|
instr(MATERIAL_NAME, '-', 1, 1) + 1,
|
|
|
|
|
length(MATERIAL_NAME)),
|
|
|
|
|
0,
|
|
|
|
|
instr(
|
|
|
|
|
substr(MATERIAL_NAME,
|
|
|
|
|
instr(MATERIAL_NAME, '-', 1, 1) + 1,
|
|
|
|
|
length(MATERIAL_NAME)), ',', 1, 1) - 1) || ')' as name
|
|
|
|
|
,
|
|
|
|
|
round(ACTUAL_QTY / ORDER_QTY * 100, 2) as qty
|
|
|
|
|
substr(MATERIAL_NAME,
|
|
|
|
|
instr(MATERIAL_NAME, '-', 1, 1) + 1,
|
|
|
|
|
length(MATERIAL_NAME)),
|
|
|
|
|
0,
|
|
|
|
|
instr(
|
|
|
|
|
substr(MATERIAL_NAME,
|
|
|
|
|
instr(MATERIAL_NAME, '-', 1, 1) + 1,
|
|
|
|
|
length(MATERIAL_NAME)), ',', 1, 1) - 1) || ')' as name
|
|
|
|
|
,
|
|
|
|
|
round(ACTUAL_QTY / ORDER_QTY * 100, 2) as rate,
|
|
|
|
|
case when round(ACTUAL_QTY / ORDER_QTY * 100, 2) < 100 then 1 else 0 end as qty
|
|
|
|
|
from IMOS_PR_ORDER
|
|
|
|
|
where FINISH_DATE between to_date(to_char(SYSDATE - 3, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
and to_date(to_char(SYSDATE - 1, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
</select>
|
|
|
|
|
where to_char(FINISH_DATE,'yyyy-MM-dd') =
|
|
|
|
|
(
|
|
|
|
|
select to_char(DAY, 'yyyy-MM-dd')
|
|
|
|
|
from (
|
|
|
|
|
select DAY,ROWNUM as qt
|
|
|
|
|
from haiwei.BASE_PRODUCT_QTY
|
|
|
|
|
where DAY < to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
order by DAY desc)
|
|
|
|
|
where qt =3)
|
|
|
|
|
union
|
|
|
|
|
select substr(ORDER_NO, 5, length(ORDER_NO)) || '(' || substr(
|
|
|
|
|
substr(MATERIAL_NAME,
|
|
|
|
|
instr(MATERIAL_NAME, '-', 1, 1) + 1,
|
|
|
|
|
length(MATERIAL_NAME)),
|
|
|
|
|
0,
|
|
|
|
|
instr(
|
|
|
|
|
substr(MATERIAL_NAME,
|
|
|
|
|
instr(MATERIAL_NAME, '-', 1, 1) + 1,
|
|
|
|
|
length(MATERIAL_NAME)), ',', 1, 1) - 1) || ')' as name
|
|
|
|
|
,
|
|
|
|
|
round(ACTUAL_QTY / ORDER_QTY * 100, 2) as rate,
|
|
|
|
|
case when round(ACTUAL_QTY / ORDER_QTY * 100, 2) < 100 then 3 else 0 end as qty
|
|
|
|
|
from IMOS_PR_ORDER
|
|
|
|
|
where to_char(FINISH_DATE,'yyyy-MM-dd') =
|
|
|
|
|
(
|
|
|
|
|
select to_char(DAY, 'yyyy-MM-dd')
|
|
|
|
|
from (
|
|
|
|
|
select DAY,ROWNUM as qt
|
|
|
|
|
from haiwei.BASE_PRODUCT_QTY
|
|
|
|
|
where DAY < to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
order by DAY desc)
|
|
|
|
|
where qt =2)
|
|
|
|
|
union
|
|
|
|
|
select substr(ORDER_NO, 5, length(ORDER_NO)) || '(' || substr(
|
|
|
|
|
substr(MATERIAL_NAME,
|
|
|
|
|
instr(MATERIAL_NAME, '-', 1, 1) + 1,
|
|
|
|
|
length(MATERIAL_NAME)),
|
|
|
|
|
0,
|
|
|
|
|
instr(
|
|
|
|
|
substr(MATERIAL_NAME,
|
|
|
|
|
instr(MATERIAL_NAME, '-', 1, 1) + 1,
|
|
|
|
|
length(MATERIAL_NAME)), ',', 1, 1) - 1) || ')' as name
|
|
|
|
|
,
|
|
|
|
|
round(ACTUAL_QTY / ORDER_QTY * 100, 2) as rate,
|
|
|
|
|
case when round(ACTUAL_QTY / ORDER_QTY * 100, 2) < 100 then 1 else 0 end as qty
|
|
|
|
|
from IMOS_PR_ORDER
|
|
|
|
|
where to_char(FINISH_DATE,'yyyy-MM-dd') =
|
|
|
|
|
(
|
|
|
|
|
select to_char(DAY, 'yyyy-MM-dd')
|
|
|
|
|
from (
|
|
|
|
|
select DAY,ROWNUM as qt
|
|
|
|
|
from haiwei.BASE_PRODUCT_QTY
|
|
|
|
|
where DAY < to_date(to_char(SYSDATE, 'yyyy-MM-dd') || '00:00:00', 'yyyy-MM-dd hh24:mi:ss')
|
|
|
|
|
order by DAY desc)
|
|
|
|
|
where qt =1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</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>
|
|
|
|
|
|