INSERT INTO [Exam_Result]
( [PID], [DeptName], [FID], [FeeItemName], [RptItemName], [TextResult], [ItemClass],  [Reporter], [ReportTime])  
SELECT
	C.ID AS PID,C.DeptName,
	D.FeeItemId AS FID,D.Name AS FeeItemName,A.NAME AS RptItemName,
	A.TextValue AS TextResult,ItemClass='检查',A.PacsVerifyOperName AS Reporter, 	A.PacsVerifyOperDate AS ReportTime
FROM PEIS.DBO.EnrollmentApplicationSheet A
LEFT JOIN PEIS.DBO.DEPARTMENT B ON A.DepartmentId=B.ID
LEFT JOIN Exam_Part C ON A.EnrollmentId=C.EID AND B.HISCODE=C.DeptCode AND B.NAME=C.DeptName
LEFT JOIN PEIS.DBO.EnrollmentApplicationSheetFeeItem D ON A.ID=D.EnrollmentApplicationSheetId
WHERE A. TextValue IS NOT NULL

SELECT TOP 20 * FROM Exam_Result

SELECT TOP 20 B.FEEITEMID,* FROM PEIS.DBO.EnrollmentApplicationSheet A 
LEFT JOIN PEIS.DBO.EnrollmentApplicationSheetFeeItem B ON A.ID=B.EnrollmentApplicationSheetId