CNCEC_SUBQHSE_WUHUAN/DataBase/版本日志/SUBQHSE_V2025-10-24-xiaj.sql

29 lines
823 B
MySQL
Raw Normal View History

2025-10-24 18:27:46 +08:00
ALTER VIEW [dbo].[View_MonthReport_InspectionManagement]
AS
/************<EFBFBD>±<EFBFBD>ȡ<EFBFBD><EFBFBD>************/
select im.InspectionId,
im.ProjectId,
im.CNProfessionalId,
im.IsOnceQualified,
im.InspectionDate,
im.CompileDate,
im.UnitId,
detail.UnitWorkId
from ProcessControl_InspectionManagement as im
left join (select distinct(InspectionId),UnitWorkId from ProcessControl_InspectionManagementDetail) as detail on detail.InspectionId = im.InspectionId
GO
update ProcessControl_InspectionManagement
set IsOnceQualified=1,InspectionDate=DATEADD(day,1,CompileDate)
where InspectionDate is null and IsOnceQualified is null and CompileDate<'2025-10-01'
GO
update ProcessControl_InspectionManagement
set InspectionDate=DATEADD(day,1,CompileDate)
where InspectionDate is null and IsOnceQualified is not null and CompileDate<'2025-10-01'
GO