添加 报表sql/BatchNoResistivity_[excel].sql

首次提交
This commit is contained in:
xiaochou164 2023-08-14 11:07:07 +00:00
parent 30354a500e
commit b1c7c00c29
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
select
order_no ,
resistivity ,
min ,
case
when min >= 1.9 then '高阻'
else '低阻'
end
from
(
select
order_no ,
resistivity,
case
when resistivity like '>%' then SUBSTRING(resistivity, 5, 7)
when resistivity like '%~%' then SUBSTRING_INDEX(resistivity, '~', 1)
when resistivity like '%-%' then SUBSTRING_INDEX(resistivity, '-', 1)
when resistivity like '<%' then SUBSTRING(resistivity, 5, 7)
when resistivity like '>%' then SUBSTRING(resistivity, 2, 7)
when resistivity like '<%' then SUBSTRING(resistivity, 2, 7)
when resistivity = '未分档'
or resistivity is null then '未分档'
end min
from
mes_sync.mes_recycle_material_storage mrms
union
select
order_no ,
resistivity,
case
when resistivity like '&gt;%' then SUBSTRING(resistivity, 5, 7)
when resistivity like '%~%' then SUBSTRING_INDEX(resistivity, '~', 1)
when resistivity like '%-%' then SUBSTRING_INDEX(resistivity, '-', 1)
when resistivity like '&lt;%' then SUBSTRING(resistivity, 5, 7)
when resistivity like '>%' then SUBSTRING(resistivity, 2, 7)
when resistivity like '<%' then SUBSTRING(resistivity, 2, 7)
when resistivity = '未分档'
or resistivity is null then '未分档'
end
from
mes_sync.mes_disposable_qc_task
)a