提交代码

This commit is contained in:
2023-10-07 16:58:43 +08:00
parent 2e1c911889
commit 98345cb94f
16 changed files with 829 additions and 497 deletions
@@ -0,0 +1,47 @@
--专项检查检查记录接收人
alter table Check_CheckSpecial add ReceiveMan nvarchar(2000) null;
--States0-保存 1-提交 2-审核通过 3-已确认
--修改专项检查明细视图
/****** Object: View [dbo].[View_CheckSpecialDetail] Script Date: 2023/9/30 11:19:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*LEFT JOIN Sys_Const AS const ON const.ConstValue = detail.HandleStep and const.GroupId='HandleStep'*/
ALTER VIEW [dbo].[View_CheckSpecialDetail]
AS
SELECT detail.CheckSpecialDetailId, detail.CheckSpecialId, detail.CheckItem, checkItemSet.CheckItemName, detail.Unqualified,
detail.SortIndex, detail.UnitId, detail.HandleStep, detail.CompleteStatus,
(CASE WHEN detail.CompleteStatus = 1 THEN '合格' ELSE '不合格' END) AS CompleteStatusName, detail.LimitedDate,
detail.CompletedDate, detail.CheckContent, detail.CheckArea,
workArea.UnitWorkName + (CASE WHEN workArea.ProjectType = '1' THEN '(建筑)' WHEN workArea.ProjectType = '2' THEN '(安装)'
ELSE '' END) AS CheckAreaName, detail.DataId, detail.DataType, unit.UnitName,
dbo.GetConstTextByIds(detail.HandleStep) AS HandleStepStr,
(CASE WHEN detail.DataType LIKE '%1%' THEN '下发整改单:' +
(SELECT RectifyNoticesCode
FROM Check_RectifyNotices
WHERE detail.DataId LIKE '%' + RectifyNoticesId + '%') ELSE '' END)
+ (CASE WHEN detail.DataType LIKE '%2%' THEN '下发处罚单:' +
(SELECT PunishNoticeCode
FROM Check_PunishNotice
WHERE detail.DataId LIKE '%' + PunishNoticeId + '%') ELSE '' END)
+ (CASE WHEN detail.DataType = '3' THEN '下发暂停令:' +
(SELECT PauseNoticeCode
FROM Check_PauseNotice
WHERE detail.DataId LIKE '%' + PauseNoticeId + '%') ELSE '' END) AS HandleStepLink, detail.HiddenHazardType,
(CASE WHEN detail.HiddenHazardType = '3' THEN '重大' WHEN detail.HiddenHazardType = '2' THEN '较大' WHEN detail.HiddenHazardType
= '1' THEN '一般' ELSE '' END) AS HiddenHazardTypeName, detail.CheckItemSetId, detail.CheckItemSetContent,
detail.Rectification_Date
FROM dbo.Check_CheckSpecialDetail AS detail LEFT OUTER JOIN
dbo.Technique_CheckItemSet AS checkItemSet ON checkItemSet.CheckItemSetId = detail.CheckItem LEFT OUTER JOIN
dbo.Base_Unit AS unit ON unit.UnitId = detail.UnitId LEFT OUTER JOIN
dbo.WBS_UnitWork AS workArea ON detail.CheckArea = workArea.UnitWorkId
GO
@@ -0,0 +1,4 @@
alter table Base_Project add ProjType nvarchar(50) null
GO
alter table Base_Project add ProjPhase nvarchar(50) null
GO