类型1、正常的图形电镀板流程是:整板镀铜——碱蚀曝光——碱蚀显影——图形电镀;
类型2、整板镀锡的板子流程是:整板镀铜——图形电镀;
类型1、ME14NU8552A0
类型2、ME22N20FHEA1
--所有过数站点的MI流程信息
select DISTINCT D50.CUSTOMER_PART_NUMBER,D38.STEP_NUMBER,D34.DEPT_CODE,D34.DEPT_NAME,D34.RKEY
INTO #ALL
--DROP TABLE #ALL
--select * from #ALL
from DATA0038 D38
INNER JOIN DATA0050 D50 ON D50.RKEY=D38.SOURCE_PTR AND D38.TTYPE=4
INNER join DATA0034 D34 ON D34.RKEY=D38.DEPT_PTR AND D34.TTYPE=1 AND D34.BARCODE_ENTRY_FLAG='Y'
group by D50.CUSTOMER_PART_NUMBER,D38.STEP_NUMBER,D34.DEPT_CODE,D34.DEPT_NAME,D34.RKEY
order by D50.CUSTOMER_PART_NUMBER,D38.STEP_NUMBER
--筛选行 整板镀铜 28
select DISTINCT CUSTOMER_PART_NUMBER
INTO #CUST_28 --整板镀铜
from #ALL
where
1=1
AND RKEY=28
order by CUSTOMER_PART_NUMBER
--筛选行 图形镀铜 183
select DISTINCT CUSTOMER_PART_NUMBER
INTO #CUST_183 --图形镀铜
from #ALL
where
1=1
AND RKEY=183
order by CUSTOMER_PART_NUMBER
--筛选有序的数据行
SELECT ROW_NUMBER() OVER(PARTITION BY CUSTOMER_PART_NUMBER ORDER BY CUSTOMER_PART_NUMBER) ID,*
INTO #分组有序号的筛选
from #ALL
where
1=1
AND #ALL.CUSTOMER_PART_NUMBER IN (SELECT CUSTOMER_PART_NUMBER FROM #CUST_28)
AND #ALL.CUSTOMER_PART_NUMBER IN (SELECT CUSTOMER_PART_NUMBER FROM #CUST_183)
order by CUSTOMER_PART_NUMBER
SELECT * INTO #T1 FROM #分组有序号的筛选 WHERE RKEY IN (28,183)
--自查询得出结果集
select #T1.CUSTOMER_PART_NUMBER INTO #RESULT from #T1
INNER join #T1 T2 on T2.CUSTOMER_PART_NUMBER=#T1.CUSTOMER_PART_NUMBER
AND T2.ID=#T1.ID+1
--验证所有料号都是28->183
SELECT * FROM #RESULT WHERE CUSTOMER_PART_NUMBER LIKE '%ME22N20FHEA1%'
select * from #分组有序号的筛选 WHERE CUSTOMER_PART_NUMBER LIKE '%ME22N20FHEA1%'