diff --git a/报表sql/BatchNoResistivity_[excel].sql b/报表sql/BatchNoResistivity_[excel].sql new file mode 100644 index 0000000..83f81be --- /dev/null +++ b/报表sql/BatchNoResistivity_[excel].sql @@ -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 '>%' 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 + from + mes_sync.mes_disposable_qc_task +)a \ No newline at end of file