ALTER VIEW [dbo].[View_CH_TrustSearch] /*委托明细表查询列表*/ AS SELECT JointInfo.JOT_ID, --焊口id JointInfo.JOT_JointNo, --焊口代号 JointInfo.JOT_JointStatus, IsoInfo.ISO_ID, --管线id IsoInfo.ISO_IsoNo, IsoInfo.UnitId, WorkArea.WorkAreaId, --区域id JointInfo.ProjectId, Point.PW_PointID, --点口 Point.PW_PointNo, Point.PW_PointType, JointInfo.JOT_JointDesc,--焊口规格 case when isoInfo.[Is_Standard] = 0 then (detectionRate.DetectionRate+'%') else (detectionRate1.DetectionRate+'%') end AS DetectionRate FROM dbo.PW_JointInfo AS JointInfo LEFT JOIN dbo.PW_IsoInfo AS IsoInfo ON IsoInfo.ISO_ID = JointInfo.ISO_ID LEFT JOIN dbo.ProjectData_WorkArea AS WorkArea ON WorkArea.WorkAreaId=IsoInfo.WorkAreaId LEFT JOIN dbo.BO_Point AS Point ON Point.PW_PointID =JointInfo.PW_PointID LEFT JOIN dbo.CH_TrustItem AS TrustItem ON TrustItem.JOT_ID =JointInfo.JOT_ID LEFT JOIN Base_DetectionRate AS detectionRate ON detectionRate.DetectionRateId = IsoInfo.DetectionRateId LEFT JOIN Base_DetectionRate AS detectionRate1 ON detectionRate1.DetectionRateId = JointInfo.DetectionRateId WHERE TrustItem.CH_TrustItemID IS NULL AND Point.PW_PointID IS NOT NULL AND JointInfo.JOT_JointStatus ='101' GO