20231030项目

This commit is contained in:
2023-10-30 11:13:57 +08:00
parent b3a0193a38
commit 5e30bb0f56
36 changed files with 392 additions and 233 deletions
@@ -0,0 +1,45 @@
ALTER TABLE [dbo].[Base_Project] ADD IsCNCECShow BIT NULL
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否向集团展示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_Project', @level2type=N'COLUMN',@level2name=N'IsCNCECShow'
GO
UPDATE Base_Project SET IsCNCECShow= 1 WHERE ProjectState=1
GO
UPDATE Base_Project SET IsCNCECShow= 0 WHERE IsCNCECShow IS NULL
GO
ALTER VIEW [dbo].[View_License_LicenseManager]
AS
/*现场安全许可证*/
SELECT LicenseManager.LicenseManagerId,
LicenseManager.ProjectId,
LicenseManager.LicenseTypeId,
LicenseManager.LicenseManagerCode,
LicenseManager.LicenseManageName,
LicenseManager.UnitId,
LicenseManager.LicenseManageContents,
LicenseManager.CompileMan,
LicenseManager.CompileDate,
LicenseManager.States,
Project.ProjectCode,
Project.ProjectName,
Project.IsCNCECShow,
LicenseType.LicenseTypeName,
Unit.UnitName,
Users.PersonName,
LicenseManager.WorkAreaId,
--WorkArea.WorkAreaName,
LicenseManager.StartDate,
LicenseManager.EndDate,
LicenseManager.ApplicantMan,
WorkAreaName = STUFF(( SELECT ',' + UnitWorkName FROM WBS_UnitWork
where PATINDEX('%,' + RTRIM(WBS_UnitWork.UnitWorkId) + ',%',',' + LicenseManager.WorkAreaId + ',')>0
ORDER BY PATINDEX('%,' + RTRIM(LicenseManager.WorkAreaId) + ',%',',' + LicenseManager.WorkAreaId + ',')
FOR XML PATH('')), 1, 1,'')
FROM dbo.License_LicenseManager AS LicenseManager
LEFT JOIN dbo.Base_Project AS Project ON Project.ProjectId = LicenseManager.ProjectId
LEFT JOIN dbo.Base_LicenseType AS LicenseType ON LicenseType.LicenseTypeId = LicenseManager.LicenseTypeId
LEFT JOIN dbo.Base_Unit AS Unit ON Unit.UnitId = LicenseManager.UnitId
LEFT JOIN dbo.Person_Persons AS Users ON Users.PersonId = LicenseManager.CompileMan
LEFT JOIN dbo.WBS_UnitWork AS WorkArea ON WorkArea.UnitWorkId = LicenseManager.WorkAreaId
GO