|
|
|
|
@ -507,4 +507,47 @@
|
|
|
|
|
group by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
order by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectOneBadRateByDay" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select nvl(qty1, 0) as qty,
|
|
|
|
|
name,
|
|
|
|
|
nvl(round((qty1 / a.qty) * 100, 2), 0) as rate
|
|
|
|
|
from (
|
|
|
|
|
select to_char(PRODUCTION_DATE, 'hh24') || ':30' as name, count(1) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE
|
|
|
|
|
where to_char(PRODUCTION_DATE, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')
|
|
|
|
|
group by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
order by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
) a
|
|
|
|
|
left join (select count(1) as qty1, to_char(CREATION_DATE, 'hh24') || ':30' as name1
|
|
|
|
|
from IMOS_QA_PRODUCT_QUALITY
|
|
|
|
|
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
|
|
|
|
|
order by name
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectOneBadRate" resultType="com.ruoyi.system.domain.BoxOutput">
|
|
|
|
|
select nvl(qty1,0) as qty,
|
|
|
|
|
name,
|
|
|
|
|
nvl(round((qty1/a.qty)*100,2),0) as rate
|
|
|
|
|
from (
|
|
|
|
|
select to_char(PRODUCTION_DATE, 'hh24') || ':30' as name, count(1) as qty
|
|
|
|
|
from IMOS_PR_PRODUCT_BARCODE ippb
|
|
|
|
|
left join (select * from haiwei.BASE_DAY_WBTIME where ROWNUM = 1 order by CREATE_TIME desc) 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'
|
|
|
|
|
group by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
order by to_char(PRODUCTION_DATE, 'hh24')
|
|
|
|
|
) a
|
|
|
|
|
left join (select count(1) as qty1, to_char(CREATION_DATE, 'hh24') || ':30' as name1
|
|
|
|
|
from IMOS_QA_PRODUCT_QUALITY
|
|
|
|
|
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
|
|
|
|
|
order by name
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|