跳至主要內容

品质部门

五六零网校大约 2 分钟

不良品处理单报表

  • 示例代码
SELECT T0.[U_DocType], T0.[U_TaxDate] AS 不良品单日期, T0.[U_BaseEntry], T0.[U_BaseEntry2], T0.[DocEntry] AS 不良品单号
	, T0.[U_CardName], T0.[U_ItemCode], T0.[U_ItemName], T0.[U_Spec], T0.[U_Qty]
	, T1.[U_Qty1], T1.[U_Qty2], T1.[U_QAItem], T1.[U_QALevel], T1.[U_AQL]
	, T1.[U_AC], T1.[U_RE], T1.[U_P1], T1.[U_Memo], T1.[U_IsPass]
	, T1.[U_Item], T0.[U_UserName1], T0.[U_UserName2]
FROM [dbo].[@OQAE] T0
	INNER JOIN [dbo].[@QAE1] T1 ON T1.docentry = t0.docentry
WHERE (T0.[U_ItemCode] >= '[%0]'
		OR '[%0]' = '')
	AND (T0.[U_ItemCode] <= '[%1]'
		OR '[%1]' = '')
	AND (T0.[U_ItemName] >= '[%2]'
		OR '[%2]' = '')
	AND (T0.[U_ItemName] <= '[%12]'
		OR '[%12]' = '')
	AND (T0.[U_TaxDate] >= '[%3]'
		OR '[%3]' = '')
	AND (T0.[U_TaxDate] <= '[%13]'
		OR '[%13]' = '')
	AND (T0.[U_CardName] >= '[%5]'
		OR '[%5]' = '')
	AND (T0.[U_CardName] <= '[%15]'
		OR '[%15]' = '')
	AND (T0.[U_DocType] >= '[%4]'
		OR '[%4]' = '')
	AND (T0.[U_DocType] <= '[%14]'
		OR '[%14]' = '')
	AND (T0.[DocEntry] >= [%9]
		OR [%9] = '')
	AND (T0.[DocEntry] <= [%19]
		OR [%19] = '')
ORDER BY T0.[DocEntry] DESC

检验单报表

  • 代码示例
SELECT T0.[DocEntry] AS 检验单号, T0.[DocNum] AS 编号, T0.[U_CardName], T0.[U_ItemCode], T0.[U_Spec]
	, CASE 
		WHEN T1.[U_QAItem] = 'A' THEN N'尺寸'
		WHEN T1.[U_QAItem] = 'B' THEN N'外观'
		WHEN T1.[U_QAItem] = 'C' THEN N'可靠性能'
	END AS '检验项目'
	, CASE 
		WHEN T1.[U_QALevel] = '1' THEN N'MIL-STD-105E-1级'
		WHEN T1.[U_QALevel] = '2' THEN N'MIL-STD-105E-2级'
		WHEN T1.[U_QALevel] = '3' THEN N'MIL-STD-105E-3级'
		WHEN T1.[U_QALevel] = '0' THEN N'MIL-STD-105E-0缺陷'
	END AS '检验水平', T1.[U_AQL], T1.[U_AC], T1.[U_RE], T1.[U_Qty] AS 批次数量
	, T1.[U_Qty1] AS 抽检数量, T1.[U_Status], T1.[U_Item], T1.[U_Qty2], T1.[U_P1]
	, T1.[U_Memo], T0.[U_UserName1], T0.[U_UserName2]
FROM [dbo].[@OQAD] T0
	INNER JOIN [dbo].[@QAD1] T1 ON T1.DOCENTRY = T0.DOCENTRY
WHERE (T0.[U_ItemCode] >= '[%0]'
		OR '[%0]' = '')
	AND (T0.[U_ItemCode] <= '[%1]'
		OR '[%1]' = '')
	AND (T0.[U_ItemName] >= '[%2]'
		OR '[%2]' = '')
	AND (T0.[U_ItemName] <= '[%12]'
		OR '[%12]' = '')
	AND (T0.[U_TaxDate] >= '[%3]'
		OR '[%3]' = '')
	AND (T0.[U_TaxDate] <= '[%13]'
		OR '[%13]' = '')
	AND (T0.[U_DocType] >= '[%4]'
		OR '[%4]' = '')
	AND (T0.[U_DocType] <= '[%14]'
		OR '[%14]' = '')
	AND (T0.[U_CardCode] >= '[%7]'
		OR '[%7]' = '')
	AND (T0.[U_CardCode] <= '[%17]'
		OR '[%17]' = '')
	AND (T0.[U_CardName] >= '[%8]'
		OR '[%8]' = '')
	AND (T0.[U_CardName] <= '[%18]'
		OR '[%18]' = '')
	AND (T0.[DocEntry] >= [%9]
		OR [%9] = '')
	AND (T0.[DocEntry] <= [%19]
		OR [%19] = '')
	AND (T0.[U_BaseEntry] >= [%10]
		OR [%10] = '')
	AND (T0.[U_BaseEntry] <= [%29]
		OR [%29] = '')
ORDER BY T0.[DocEntry] DESC

送检单报表

  • 代码示例
SELECT T0.[DocEntry] AS 送检单号, T0.[DocNum] AS 编号, T0.[U_TaxDate], T1.[U_ItemCode], T1.[U_ItemName]
	, T1.[U_Spec], T1.[U_MacSer], T1.[U_Qty2], T1.[U_Qty] AS 批次数量, T0.[CreateTime] AS 创建时间
	, CASE 
		WHEN T0.[U_DocType] = 'A' THEN N'来料'
		WHEN T0.[U_DocType] = 'B' THEN N'出货'
		WHEN T0.[U_DocType] = 'C' THEN N'库存'
	END AS 报检类型
	, CASE 
		WHEN T1.[U_OQADEntry] = '-1' THEN N'已报检'
		WHEN T1.[U_OQADEntry] <> '-1' THEN N'已检验'
	END AS 单据状态, T1.[U_BaseNum], T1.[U_BaseLine], T1.[U_OQADEntry]
FROM [dbo].[@OQAS] T0
	INNER JOIN [dbo].[@QAS1] T1 ON T1.docentry = t0.docentry
WHERE (T1.[U_ItemCode] >= '[%0]'
		OR '[%0]' = '')
	AND (T1.[U_ItemCode] <= '[%1]'
		OR '[%1]' = '')
	AND (T1.[U_ItemName] >= '[%2]'
		OR '[%2]' = '')
	AND (T1.[U_ItemName] <= '[%12]'
		OR '[%12]' = '')
	AND (T0.[U_TaxDate] >= '[%3]'
		OR '[%3]' = '')
	AND (T0.[U_TaxDate] <= '[%13]'
		OR '[%13]' = '')
	AND (T0.[U_DocType] >= '[%4]'
		OR '[%4]' = '')
	AND (T0.[U_DocType] <= '[%14]'
		OR '[%14]' = '')
	AND (T0.[U_DeptName] >= '[%5]'
		OR '[%5]' = '')
	AND (T0.[U_DeptName] <= '[%15]'
		OR '[%15]' = '')
	AND (T0.[U_UserName1] >= '[%6]'
		OR '[%6]' = '')
	AND (T0.[U_UserName1] <= '[%16]'
		OR '[%16]' = '')
	AND (T0.[U_CardCode] >= '[%7]'
		OR '[%7]' = '')
	AND (T0.[U_CardCode] <= '[%17]'
		OR '[%17]' = '')
	AND (T0.[U_CardName] >= '[%8]'
		OR '[%8]' = '')
	AND (T0.[U_CardName] <= '[%18]'
		OR '[%18]' = '')
	AND (T0.[DocEntry] >= [%9]
		OR [%9] = '')
	AND (T0.[DocEntry] <= [%19]
		OR [%19] = '')
ORDER BY T0.[DocEntry] DESC