ChengDa_English/DataBase/版本日志/SGGLDB_CD_V2023-04-30-001.sql

40 lines
1.2 KiB
Transact-SQL

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