This commit is contained in:
2025-10-24 18:27:46 +08:00
parent 47172cd0b3
commit 78a2b0f525
47 changed files with 678 additions and 277 deletions
@@ -0,0 +1,28 @@
ALTER VIEW [dbo].[View_MonthReport_InspectionManagement]
AS
/************Ô±¨È¡Êý************/
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