CREATE TABLE [dbo].[ProcessControl_InspectionManagement]( [InspectionId] [nvarchar](50) NOT NULL, [ProjectId] [nvarchar](50) NOT NULL, [UnitId] [nvarchar](50) NOT NULL, [CNProfessionalId] [nvarchar](50) NULL, [InspectionCode] [nvarchar](50) NULL, [UnitWorkId] [nvarchar](50) NULL, [Branch] [nvarchar](50) NULL, [ControlPointType] [nvarchar](50) NULL, [AcceptanceSite] [nvarchar](50) NULL, [IsOnceQualified] [bit] NULL, [InspectionDate] [datetime] NULL, [AttachUrl] [nvarchar](2000) NULL, [CheckDate] [datetime] NULL, [CheckMan] [nvarchar](50) NULL, [UnqualifiedReason] [nvarchar](1000) NULL, [NoticeCode] [nvarchar](50) NULL, [AcceptanceCheckMan] [nvarchar](50) NULL, [ParentDivisionProjectId] [nvarchar](50) NULL, [CompileMan] [nvarchar](50) NULL, [CompileDate] [datetime] NULL, [FileType] [nvarchar](10) NULL, [AttachUrl2] [nvarchar](2000) NULL, CONSTRAINT [PK_ProcessControl_InspectionManagement] PRIMARY KEY CLUSTERED ( [InspectionId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_InspectionManagement_Base_Project] FOREIGN KEY([ProjectId]) REFERENCES [dbo].[Base_Project] ([ProjectId]) GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] CHECK CONSTRAINT [FK_ProcessControl_InspectionManagement_Base_Project] GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_InspectionManagement_Base_Unit] FOREIGN KEY([UnitId]) REFERENCES [dbo].[Base_Unit] ([UnitId]) GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] CHECK CONSTRAINT [FK_ProcessControl_InspectionManagement_Base_Unit] GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_InspectionManagement_Sys_User] FOREIGN KEY([CompileMan]) REFERENCES [dbo].[Sys_User] ([UserId]) GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] CHECK CONSTRAINT [FK_ProcessControl_InspectionManagement_Sys_User] GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_InspectionManagement_Base_CNProfessional] FOREIGN KEY([CNProfessionalId]) REFERENCES [dbo].[Base_CNProfessional] ([CNProfessionalId]) GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] CHECK CONSTRAINT [FK_ProcessControl_InspectionManagement_Base_CNProfessional] GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_InspectionManagement_WBS_UnitWork] FOREIGN KEY([UnitWorkId]) REFERENCES [dbo].[WBS_UnitWork] ([UnitWorkId]) GO ALTER TABLE [dbo].[ProcessControl_InspectionManagement] CHECK CONSTRAINT [FK_ProcessControl_InspectionManagement_WBS_UnitWork] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'InspectionId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'ProjectId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'UnitId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专业ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'CNProfessionalId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'报验编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'InspectionCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单元ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'UnitWorkId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分部' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'Branch' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'质量控制点类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'ControlPointType' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'验收部位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'AcceptanceSite' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否一次合格' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'IsOnceQualified' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'验收日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'InspectionDate' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'附件(照片)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement', @level2type=N'COLUMN',@level2name=N'AttachUrl' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'检验批管理表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagement' GO CREATE TABLE [dbo].[ProcessControl_HotProessManage]( [HotProessManageId] [nvarchar](50) NOT NULL, [ProjectId] [nvarchar](50) NULL, [PipelineManageCode] [nvarchar](200) NOT NULL, [JointInfoCode] [nvarchar](200) NULL, [STE_ID] [varchar](50) NULL, [Specification] [nvarchar](200) NULL, [HotProessReportCode] [nvarchar](200) NULL, [HotHardManageCode] [nvarchar](200) NULL, [CompileMan] [nvarchar](50) NULL, CONSTRAINT [PK_ProcessControl_HotProessManage] PRIMARY KEY CLUSTERED ( [HotProessManageId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[ProcessControl_HotProessManage] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_HotProessManage_Base_Project] FOREIGN KEY([ProjectId]) REFERENCES [dbo].[Base_Project] ([ProjectId]) GO ALTER TABLE [dbo].[ProcessControl_HotProessManage] CHECK CONSTRAINT [FK_ProcessControl_HotProessManage_Base_Project] GO ALTER TABLE [dbo].[ProcessControl_HotProessManage] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_HotProessManage_BS_Steel] FOREIGN KEY([STE_ID]) REFERENCES [dbo].[BS_Steel] ([STE_ID]) GO ALTER TABLE [dbo].[ProcessControl_HotProessManage] CHECK CONSTRAINT [FK_ProcessControl_HotProessManage_BS_Steel] GO ALTER TABLE [dbo].[ProcessControl_HotProessManage] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_HotProessManage_Sys_User] FOREIGN KEY([CompileMan]) REFERENCES [dbo].[Sys_User] ([UserId]) GO ALTER TABLE [dbo].[ProcessControl_HotProessManage] CHECK CONSTRAINT [FK_ProcessControl_HotProessManage_Sys_User] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'热处理检测主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_HotProessManage', @level2type=N'COLUMN',@level2name=N'HotProessManageId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管线号 ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_HotProessManage', @level2type=N'COLUMN',@level2name=N'PipelineManageCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'焊口号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_HotProessManage', @level2type=N'COLUMN',@level2name=N'JointInfoCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'材质' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_HotProessManage', @level2type=N'COLUMN',@level2name=N'STE_ID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'规格' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_HotProessManage', @level2type=N'COLUMN',@level2name=N'Specification' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'热处理报告编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_HotProessManage', @level2type=N'COLUMN',@level2name=N'HotProessReportCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'硬度检测报告编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_HotProessManage', @level2type=N'COLUMN',@level2name=N'HotHardManageCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'热处理检测表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_HotProessManage' GO CREATE TABLE [dbo].[ProcessControl_NondestructiveTest]( [NondestructiveTestId] [nvarchar](50) NOT NULL, [ProjectId] [nvarchar](50) NOT NULL, [UnitWorkId] [nvarchar](50) NULL, [UnitId] [nvarchar](50) NOT NULL, [WelderCode] [nvarchar](50) NULL, [NondestructiveTestCode] [nvarchar](50) NOT NULL, [PieceCount] [int] NULL, [OnceQualifiedCount] [int] NULL, [NondestructiveTestDate] [datetime] NULL, [WED_ID] [nvarchar](50) NULL, [STE_ID] [varchar](50) NULL, [CompileMan] [nvarchar](50) NULL, [InspectionAreaId] [nvarchar](50) NULL, CONSTRAINT [PK_ProcessControl_NondestructiveTest] PRIMARY KEY CLUSTERED ( [NondestructiveTestId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_NondestructiveTest_Base_InspectionArea] FOREIGN KEY([InspectionAreaId]) REFERENCES [dbo].[Base_InspectionArea] ([InspectionAreaId]) GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] CHECK CONSTRAINT [FK_ProcessControl_NondestructiveTest_Base_InspectionArea] GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_NondestructiveTest_Base_Project] FOREIGN KEY([ProjectId]) REFERENCES [dbo].[Base_Project] ([ProjectId]) GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] CHECK CONSTRAINT [FK_ProcessControl_NondestructiveTest_Base_Project] GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_NondestructiveTest_Base_Unit] FOREIGN KEY([UnitId]) REFERENCES [dbo].[Base_Unit] ([UnitId]) GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] CHECK CONSTRAINT [FK_ProcessControl_NondestructiveTest_Base_Unit] GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_NondestructiveTest_Comprehensive_InspectionPerson] FOREIGN KEY([WED_ID]) REFERENCES [dbo].[Comprehensive_InspectionPerson] ([InspectionPersonId]) GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] CHECK CONSTRAINT [FK_ProcessControl_NondestructiveTest_Comprehensive_InspectionPerson] GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_NondestructiveTest_WBS_UnitWork] FOREIGN KEY([UnitWorkId]) REFERENCES [dbo].[WBS_UnitWork] ([UnitWorkId]) GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] CHECK CONSTRAINT [FK_ProcessControl_NondestructiveTest_WBS_UnitWork] GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] WITH CHECK ADD CONSTRAINT [ProcessControl_NondestructiveTest_BS_Welder_STE_ID] FOREIGN KEY([STE_ID]) REFERENCES [dbo].[BS_Steel] ([STE_ID]) GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] CHECK CONSTRAINT [ProcessControl_NondestructiveTest_BS_Welder_STE_ID] GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] WITH CHECK ADD CONSTRAINT [ProcessControl_NondestructiveTest_Sys_User] FOREIGN KEY([CompileMan]) REFERENCES [dbo].[Sys_User] ([UserId]) GO ALTER TABLE [dbo].[ProcessControl_NondestructiveTest] CHECK CONSTRAINT [ProcessControl_NondestructiveTest_Sys_User] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest', @level2type=N'COLUMN',@level2name=N'NondestructiveTestId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest', @level2type=N'COLUMN',@level2name=N'ProjectId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单元ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest', @level2type=N'COLUMN',@level2name=N'UnitWorkId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest', @level2type=N'COLUMN',@level2name=N'UnitId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'焊工代号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest', @level2type=N'COLUMN',@level2name=N'WelderCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'报告编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest', @level2type=N'COLUMN',@level2name=N'NondestructiveTestCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'片数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest', @level2type=N'COLUMN',@level2name=N'PieceCount' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'一次合格数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest', @level2type=N'COLUMN',@level2name=N'OnceQualifiedCount' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest', @level2type=N'COLUMN',@level2name=N'NondestructiveTestDate' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'无损检测管理表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_NondestructiveTest' GO CREATE TABLE [dbo].[ProcessControl_TestPackageManagement]( [TestPackageManagementId] [nvarchar](50) NOT NULL, [ProjectId] [nvarchar](50) NOT NULL, [TestPackageManagementCode] [nvarchar](50) NOT NULL, [UnitWorkId] [nvarchar](50) NULL, [TestMedium] [nvarchar](50) NULL, [TestPressure] [nvarchar](50) NULL, [PlanTestDate] [datetime] NULL, [CompletedDate] [datetime] NULL, [CompletedState] [char](1) NULL, [Remark] [nvarchar](200) NULL, CONSTRAINT [PK_ProcessControl_TestPackageManagement] PRIMARY KEY CLUSTERED ( [TestPackageManagementId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[ProcessControl_TestPackageManagement] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_TestPackageManagement_Base_Project] FOREIGN KEY([ProjectId]) REFERENCES [dbo].[Base_Project] ([ProjectId]) GO ALTER TABLE [dbo].[ProcessControl_TestPackageManagement] CHECK CONSTRAINT [FK_ProcessControl_TestPackageManagement_Base_Project] GO ALTER TABLE [dbo].[ProcessControl_TestPackageManagement] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_TestPackageManagement_WBS_UnitWork] FOREIGN KEY([UnitWorkId]) REFERENCES [dbo].[WBS_UnitWork] ([UnitWorkId]) GO ALTER TABLE [dbo].[ProcessControl_TestPackageManagement] CHECK CONSTRAINT [FK_ProcessControl_TestPackageManagement_WBS_UnitWork] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'TestPackageManagementId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'ProjectId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'试压包编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'TestPackageManagementCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单元名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'UnitWorkId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'试验介质' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'TestMedium' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'试验压力' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'TestPressure' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'计划试验日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'PlanTestDate' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'试验完成日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'CompletedDate' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'完成状态(1-已完成,2-未完成)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'CompletedState' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement', @level2type=N'COLUMN',@level2name=N'Remark' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管道试压包管理表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_TestPackageManagement' GO CREATE VIEW [dbo].[View_InspectionManagement] AS SELECT I.InspectionId, I.ProjectId, P.ProjectCode, --项目号 P.ProjectName, --项目名称 I.UnitId, U.UnitName, --施工分包商 I.InspectionCode, --编号 I.CompileMan, Users.UserName,--编制人 I.CompileDate, I.UnitWorkId, UnitWork.UnitWorkName,--单元 DivisionProject.DivisionName AS Branch, --分部 BreakdownProject.BreakdownName AS ControlPointType, --控制点内容 BreakdownProject.Class,--控制点等级 BreakdownProject.Basis,--质量检查依据 I.AcceptanceSite, --验收部位 I.InspectionDate --签收日期 FROM ProcessControl_InspectionManagement AS I LEFT JOIN dbo.Base_Project AS P ON P.ProjectId=I.ProjectId LEFT JOIN dbo.Base_Unit AS U ON U.UnitId=I.UnitId LEFT JOIN dbo.Sys_User AS Users ON Users.UserId=I.CompileMan LEFT JOIN dbo.WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId=I.UnitWorkId LEFT JOIN dbo.WBS_DivisionProject AS DivisionProject ON DivisionProject.DivisionProjectId=I.Branch LEFT JOIN dbo.WBS_BreakdownProject AS BreakdownProject ON BreakdownProject.BreakdownProjectId=I.ControlPointType GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('149f1f1c-a925-412b-970e-e9b79d54e03f','过程控制','',10,'0','Menu_CQMS',0,0,1) GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('4781f467-35bf-4cf2-aaa4-7960a175eb61','共检通知单','CQMS/ProcessControl/InspectionNotice.aspx',10,'149f1f1c-a925-412b-970e-e9b79d54e03f','Menu_CQMS',0,1,1) GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('9550469e-7b6f-491b-b680-a1203bf9fb15','4781f467-35bf-4cf2-aaa4-7960a175eb61','增加',1) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('302edae2-b68f-4bff-b1a4-65e98bba18e9','4781f467-35bf-4cf2-aaa4-7960a175eb61','修改',2) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('febb75b4-bd83-4845-93e1-2e8d39a72897','4781f467-35bf-4cf2-aaa4-7960a175eb61','删除',3) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('72d8ac60-47f6-401a-8eaf-9ed6356a1ff4','4781f467-35bf-4cf2-aaa4-7960a175eb61','保存',4) GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('e728cc1a-fd65-4f1a-8f22-2b72e62f78ee','控制点检查检测','CQMS/ProcessControl/InspectionManagement.aspx',15,'149f1f1c-a925-412b-970e-e9b79d54e03f','Menu_CQMS',0,1,1) GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('ab131caf-350b-4f65-bd08-7ecad576236e','e728cc1a-fd65-4f1a-8f22-2b72e62f78ee','增加',1) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('864d7245-09d8-46d2-a945-0d1e0743fd09','e728cc1a-fd65-4f1a-8f22-2b72e62f78ee','修改',2) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('167dd775-ad22-44eb-ba18-f3b9437f4f84','e728cc1a-fd65-4f1a-8f22-2b72e62f78ee','删除',3) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('9e43ed04-c287-4702-a951-41b2bdcfd46d','e728cc1a-fd65-4f1a-8f22-2b72e62f78ee','保存',4) GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('d563d7a9-e574-4e25-b868-a124aa789789','控制点检查检测合格率统计','CQMS/ProcessControl/InspectionManagementStatistics.aspx',20,'149f1f1c-a925-412b-970e-e9b79d54e03f','Menu_CQMS',0,1,1) GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('a3d25055-ab1f-46e5-8820-96d0afaf88d1','d563d7a9-e574-4e25-b868-a124aa789789','增加',1) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('ec944e22-8b23-4dc4-9b06-738f144d020a','d563d7a9-e574-4e25-b868-a124aa789789','修改',2) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('baf49264-7a99-4870-82a4-ce523ab83afb','d563d7a9-e574-4e25-b868-a124aa789789','删除',3) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('02343af9-4fc9-43ab-adb2-9b529fdab3cf','d563d7a9-e574-4e25-b868-a124aa789789','保存',4) GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('ec1d25f6-fc6d-4b76-877d-d545669b21c9','无损检测管理','CQMS/ProcessControl/NondestructiveTest.aspx',25,'149f1f1c-a925-412b-970e-e9b79d54e03f','Menu_CQMS',0,1,1) GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('5172ee9e-5364-4d08-b179-4215264439e4','ec1d25f6-fc6d-4b76-877d-d545669b21c9','增加',1) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('c3eb249b-5df9-4754-abb1-1bd69b1949a6','ec1d25f6-fc6d-4b76-877d-d545669b21c9','修改',2) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('87bfc2cf-6860-4b84-91c1-33b703df5d8a','ec1d25f6-fc6d-4b76-877d-d545669b21c9','删除',3) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('bbc795b7-39a9-4f11-8bc4-9eeda3dea4b7','ec1d25f6-fc6d-4b76-877d-d545669b21c9','保存',4) GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('e6b18529-5d1b-4fde-bdab-7354b996e5de','热处理检测','CQMS/ProcessControl/HotProessManage.aspx',30,'149f1f1c-a925-412b-970e-e9b79d54e03f','Menu_CQMS',0,1,1) GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('5ace462a-1fcd-4560-86c3-81d091ab81f7','e6b18529-5d1b-4fde-bdab-7354b996e5de','增加',1) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('45f19388-bf89-4c77-8078-96ceaf0dabaf','e6b18529-5d1b-4fde-bdab-7354b996e5de','修改',2) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('cb181257-407d-4e19-b866-f91ad792e465','e6b18529-5d1b-4fde-bdab-7354b996e5de','删除',3) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('4d573638-cd56-43c0-89bb-1d4ae19e1c72','e6b18529-5d1b-4fde-bdab-7354b996e5de','保存',4) GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('6177c436-5cc7-4ed9-929c-6b7d2082fd28','管道试压包管理','CQMS/ProcessControl/TestPackageManagement.aspx',35,'149f1f1c-a925-412b-970e-e9b79d54e03f','Menu_CQMS',0,1,1) GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('39a451cb-e7a5-4f4f-89ef-704d5fff84bd','6177c436-5cc7-4ed9-929c-6b7d2082fd28','增加',1) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('133be610-d43f-42ba-8485-b203005e4857','6177c436-5cc7-4ed9-929c-6b7d2082fd28','修改',2) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('b88219ef-e618-4f4a-b47f-30422fa70032','6177c436-5cc7-4ed9-929c-6b7d2082fd28','删除',3) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('4afaf68c-85d7-4b1b-adae-afef2d137518','6177c436-5cc7-4ed9-929c-6b7d2082fd28','保存',4) GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('3e0bf9b3-b497-4627-b93c-367dd60f901d','检查人检查次数统计','CQMS/ProcessControl/CheckManStatistics.aspx',40,'149f1f1c-a925-412b-970e-e9b79d54e03f','Menu_CQMS',0,1,1) GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('c6587082-25cd-4ced-b4a2-bc9fe53d248d','3e0bf9b3-b497-4627-b93c-367dd60f901d','增加',1) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('a3f3c18a-aad7-4e1e-8ca2-955977c27e84','3e0bf9b3-b497-4627-b93c-367dd60f901d','修改',2) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('c5e700dd-cdfa-4aae-a83c-b8ca3a9eb397','3e0bf9b3-b497-4627-b93c-367dd60f901d','删除',3) INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('070cfa03-6fb4-4eb9-aaa1-568d26abdb4d','3e0bf9b3-b497-4627-b93c-367dd60f901d','保存',4) GO CREATE TABLE [dbo].[DataBase_StartWorkReport]( [StartWorkReportId] [nvarchar](50) NOT NULL, [ProjectId] [nvarchar](50) NULL, [DataTypeProjectId] [nvarchar](50) NULL, [FileCode] [nvarchar](50) NULL, [FileContent] [nvarchar](200) NULL, [CNProfessionalId] [nvarchar](50) NULL, [UnitWorkIds] [nvarchar](500) NULL, [UnitIds] [nvarchar](500) NULL, [Remark] [nvarchar](200) NULL, [AttachUrl] [nvarchar](1000) NULL, [CompileMan] [nvarchar](50) NULL, [CompileDate] [datetime] NULL, CONSTRAINT [PK_DataBase_StartWorkReport] PRIMARY KEY CLUSTERED ( [StartWorkReportId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[DataBase_StartWorkReport] WITH CHECK ADD CONSTRAINT [FK_DataBase_StartWorkReport_Base_CNProfessional] FOREIGN KEY([CNProfessionalId]) REFERENCES [dbo].[Base_CNProfessional] ([CNProfessionalId]) GO ALTER TABLE [dbo].[DataBase_StartWorkReport] CHECK CONSTRAINT [FK_DataBase_StartWorkReport_Base_CNProfessional] GO ALTER TABLE [dbo].[DataBase_StartWorkReport] WITH CHECK ADD CONSTRAINT [FK_DataBase_StartWorkReport_Base_Project] FOREIGN KEY([ProjectId]) REFERENCES [dbo].[Base_Project] ([ProjectId]) GO ALTER TABLE [dbo].[DataBase_StartWorkReport] CHECK CONSTRAINT [FK_DataBase_StartWorkReport_Base_Project] GO ALTER TABLE [dbo].[DataBase_StartWorkReport] WITH CHECK ADD CONSTRAINT [FK_DataBase_StartWorkReport_DataBase_DataTypeProject] FOREIGN KEY([DataTypeProjectId]) REFERENCES [dbo].[DataBase_DataTypeProject] ([DataTypeProjectId]) GO ALTER TABLE [dbo].[DataBase_StartWorkReport] CHECK CONSTRAINT [FK_DataBase_StartWorkReport_DataBase_DataTypeProject] GO ALTER TABLE [dbo].[DataBase_StartWorkReport] WITH CHECK ADD CONSTRAINT [FK_DataBase_StartWorkReport_Sys_User] FOREIGN KEY([CompileMan]) REFERENCES [dbo].[Sys_User] ([UserId]) GO ALTER TABLE [dbo].[DataBase_StartWorkReport] CHECK CONSTRAINT [FK_DataBase_StartWorkReport_Sys_User] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'StartWorkReportId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'ProjectId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资料库类别Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'DataTypeProjectId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'FileCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开工报告内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'FileContent' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专业' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'CNProfessionalId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单元' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'UnitWorkIds' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'UnitIds' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'Remark' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'整理人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport', @level2type=N'COLUMN',@level2name=N'CompileMan' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开工报告' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_StartWorkReport' GO CREATE TABLE [dbo].[DataBase_File]( [FileId] [nvarchar](50) NOT NULL, [ProjectId] [nvarchar](50) NULL, [DataTypeProjectId] [nvarchar](50) NULL, [FileCode] [nvarchar](50) NULL, [FileName] [nvarchar](100) NULL, [Pages] [int] NULL, [Remark] [nvarchar](200) NULL, [CompileDate] [datetime] NULL, [CompileMan] [nvarchar](50) NULL, [AttachUrl] [nvarchar](2000) NULL, [UnitWorkId] [nvarchar](50) NULL, [DivisionProjectId] [nvarchar](50) NULL, [UnitId] [nvarchar](50) NULL, [FileType] [nvarchar](50) NULL, CONSTRAINT [PK_DataBase_File] PRIMARY KEY CLUSTERED ( [FileId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[DataBase_File] WITH CHECK ADD CONSTRAINT [FK_DataBase_File_Base_Project] FOREIGN KEY([ProjectId]) REFERENCES [dbo].[Base_Project] ([ProjectId]) GO ALTER TABLE [dbo].[DataBase_File] CHECK CONSTRAINT [FK_DataBase_File_Base_Project] GO ALTER TABLE [dbo].[DataBase_File] WITH CHECK ADD CONSTRAINT [FK_DataBase_File_DataBase_DataTypeProject] FOREIGN KEY([DataTypeProjectId]) REFERENCES [dbo].[DataBase_DataTypeProject] ([DataTypeProjectId]) GO ALTER TABLE [dbo].[DataBase_File] CHECK CONSTRAINT [FK_DataBase_File_DataBase_DataTypeProject] GO ALTER TABLE [dbo].[DataBase_File] WITH CHECK ADD CONSTRAINT [FK_DataBase_File_DataBase_File] FOREIGN KEY([FileId]) REFERENCES [dbo].[DataBase_File] ([FileId]) GO ALTER TABLE [dbo].[DataBase_File] CHECK CONSTRAINT [FK_DataBase_File_DataBase_File] GO ALTER TABLE [dbo].[DataBase_File] WITH CHECK ADD CONSTRAINT [FK_DataBase_File_Sys_User] FOREIGN KEY([CompileMan]) REFERENCES [dbo].[Sys_User] ([UserId]) GO ALTER TABLE [dbo].[DataBase_File] CHECK CONSTRAINT [FK_DataBase_File_Sys_User] GO ALTER TABLE [dbo].[DataBase_File] WITH CHECK ADD CONSTRAINT [FK_DataBase_File_WBS_UnitWork] FOREIGN KEY([UnitWorkId]) REFERENCES [dbo].[WBS_UnitWork] ([UnitWorkId]) GO ALTER TABLE [dbo].[DataBase_File] CHECK CONSTRAINT [FK_DataBase_File_WBS_UnitWork] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'FileId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'ProjectId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资料类别Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'DataTypeProjectId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'FileCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'FileName' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'页次' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'Pages' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'Remark' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'整理日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'CompileDate' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'整理人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'CompileMan' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'附件路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'AttachUrl' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应WBS时的装置Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'UnitWorkId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应WBS时的分部Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File', @level2type=N'COLUMN',@level2name=N'DivisionProjectId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目资料文件表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File' GO CREATE VIEW [dbo].[View_DataBaseProject] AS --设计交底管理表 SELECT D.DesignDetailsId AS DataBaseId --id ,D.ProjectId --项目id ,'' as UnitId ,D.CNProfessionalId --专业id ,D.DesignDetailsCode AS FileCode --文件编号 , I.UnitWorkName AS FileNames --文件名称 ,'施工设计交底管理' AS FileType ,D.CompileDate AS Dates --整理时间 ,U.UserName AS Man --整理人 ,D.AttachUrl AS Url --附件 ,C.ProfessionalName AS Major --专业 FROM dbo.Comprehensive_DesignDetails AS D LEFT JOIN dbo.Base_DesignProfessional AS P ON P.DesignProfessionalId=D.CNProfessionalId LEFT JOIN dbo.Base_CNProfessional AS C ON C.CNProfessionalId =P.ToCN LEFT JOIN dbo.Sys_User AS U ON U.UserId=D.CompileMan LEFT JOIN dbo.WBS_UnitWork AS I ON I.UnitWorkId=D.UnitWorkId UNION --人员报验表 SELECT I.InspectionPersonId AS DataBaseId ,I.ProjectId ,I.UnitId ,I.CNProfessionalId ,I.InspectionPersonCode AS FileCode ,I.PersonName AS FileNames ,'施工单位和特种作业人员资质证明文件' AS FileType ,I.CompileDate AS Dates ,U.UserName AS Man ,I.AttachUrl AS Url ,C.ProfessionalName AS Major FROM dbo.Comprehensive_InspectionPerson AS I LEFT JOIN dbo.Base_CNProfessional AS C ON C.CNProfessionalId =I.CNProfessionalId LEFT JOIN dbo.Sys_User AS U ON U.UserId = I.CompileMan UNION --质量事故处理记录表 SELECT Q.QualityAccidentId AS DataBaseId --id ,Q.ProjectId ,Q.UnitId ,'' AS CNProfessionalId ,'' AS FileCode ,(T.UnitName + Q.Place) AS FileNames ,'专业工程重大质量事故处理鉴定报告' AS FileType ,Q.CompileDate AS Dates ,U.UserName AS Man ,Q.AttachUrl AS Url ,'' AS Major FROM dbo.Comprehensive_QualityAccident AS Q LEFT JOIN dbo.Sys_User AS U ON U.UserId=Q.CompileMan LEFT JOIN dbo.Base_Unit AS T ON T.UnitId=Q.UnitId UNION --设备材料报验 SELECT I.InspectionEquipmentId AS DataBaseId ,I.ProjectId ,I.UnitId ,I.CNProfessionalId ,I.InspectionCode AS FileCode ,I.InspectionName AS FileNames ,'设备报审文件 (报审表 SH/T 3903-A9)' AS FileType ,I.CompileDate AS Dates ,U.UserName AS Man ,I.AttachUrl AS Url ,C.ProfessionalName AS Major FROM dbo.Comprehensive_InspectionEquipment AS I LEFT JOIN dbo.Base_CNProfessional AS C ON C.CNProfessionalId =I.CNProfessionalId LEFT JOIN dbo.Sys_User AS U ON U.UserId=I.CompileMan Left join dbo.Base_Unit as unit on unit.UnitId=I.UnitId where unit.UnitName like '%五环%' UNION -- 一般方案审批 SELECT G.GeneralPlanApprovalId AS DataBaseId ,G.ProjectId ,G.UnitId ,G.CNProfessionalId ,G.PlanCode AS FileCode ,G.PlanName AS FileNames ,'施工技术方案、施工技术措施(包括冬季施工措施)、施工作业指导书等报批文件' AS FileType ,G.CompileDate AS Dates ,U.UserName AS Man ,G.AttachUrl AS Url ,C.ProfessionalName AS Major FROM dbo.Comprehensive_GeneralPlanApproval AS G LEFT JOIN dbo.Base_CNProfessional AS C ON C.CNProfessionalId =G.CNProfessionalId LEFT JOIN dbo.Sys_User AS U ON U.UserId=G.CompileMan UNION --重大方案审批 SELECT M.MajorPlanApprovalId AS DataBaseId ,M.ProjectId ,M.UnitId ,M.CNProfessionalId ,M.PlanCode AS FileCode ,M.PlanName AS FileNames ,'施工技术方案、施工技术措施(包括冬季施工措施)、施工作业指导书等报批文件' AS FileType ,M.CompileDate AS Dates ,U.UserName AS Man ,M.AttachUrl AS Url ,C.ProfessionalName AS Major FROM dbo.Comprehensive_MajorPlanApproval AS M LEFT JOIN dbo.Base_CNProfessional AS C ON C.CNProfessionalId =M.CNProfessionalId LEFT JOIN dbo.Sys_User AS U ON U.UserId=M.CompileMan UNION --机具报验 SELECT I.InspectionMachineId AS DataBaseId ,I.ProjectId ,I.UnitId ,I.CNProfessionalId ,I.InspectionMachineCode AS FileCode ,I.InspectionMachineName AS FileNames ,'施工设备、机具和检测量器具等报审报批文件' AS FileType ,I.CompileDate AS Dates ,U.UserName AS Man ,I.AttachUrl AS Url ,C.ProfessionalName AS Major FROM dbo.Comprehensive_InspectionMachine AS I LEFT JOIN dbo.Base_CNProfessional AS C ON C.CNProfessionalId =I.CNProfessionalId LEFT JOIN dbo.Sys_User AS U ON U.UserId=I.CompileMan UNION --设计变更 SELECT D.DesignChangeOrderId AS DataBaseId ,D.ProjectId ,'' as UnitId ,D.CNProfessionalId ,D.ChangeOrderCode AS FileCode ,D.ChangeReason AS FileNames ,'专业设计变更文件' AS FileType ,D.CompileDate AS Dates ,U.UserName AS Man ,D.AttachUrl AS Url ,C.ProfessionalName AS Major FROM dbo.Comprehensive_DesignChangeOrder AS D LEFT JOIN dbo.Base_CNProfessional AS C ON C.CNProfessionalId =D.CNProfessionalId LEFT JOIN dbo.Sys_User AS U ON U.UserId=D.CompileMan UNION --设计交底 SELECT D.DesignDetailsId AS DataBaseId ,D.ProjectId ,D.UnitName as UnitId ,D.CNProfessionalId ,D.DesignDetailsCode AS FileCode ,'设计交底管理文件' AS FileNames ,'设计技术交底和设计图纸会审纪要' AS FileType ,D.CompileDate AS Dates ,U.UserName AS Man ,D.AttachUrl AS Url ,C.ProfessionalName AS Major FROM dbo.Comprehensive_DesignDetails AS D LEFT JOIN dbo.Base_CNProfessional AS C ON C.CNProfessionalId =D.CNProfessionalId LEFT JOIN dbo.Sys_User AS U ON U.UserId=D.CompileMan GO CREATE VIEW [dbo].[View_ProcessControl_InspectionManagement] AS SELECT I.InspectionId AS FileId ,I.ProjectId ,I.FileType ,unit.UnitName ,I.CNProfessionalId ,I.InspectionCode AS FileCode --文件编号 ,I.NoticeCode AS FileName --文件名称 ,'' AS Pages ,I.CompileDate ,U.UserName AS CompileManName ,I.UnitWorkId ,case when I.ParentDivisionProjectId='' then I.Branch else I.ParentDivisionProjectId end as ParentDivisionProjectId ,I.AttachUrl2 as AttachUrl ,W.UnitWorkName --单元 ,C.ProfessionalName --专业 ,D.DivisionName --分部 ,B.IsYellow FROM dbo.ProcessControl_InspectionManagement AS I LEFT JOIN dbo.WBS_UnitWork AS W ON W.UnitWorkId=I.UnitWorkId Left join dbo.base_unit as unit on unit.UnitId=I.UnitId LEFT JOIN dbo.Base_CNProfessional AS C ON C.CNProfessionalId=I.CNProfessionalId LEFT JOIN dbo.WBS_DivisionProject AS D ON D.DivisionProjectId=I.Branch LEFT JOIN dbo.WBS_BreakdownProject AS B ON B.BreakdownProjectId=I.ControlPointType LEFT JOIN dbo.Sys_User AS U ON U.UserId=I.CompileMan GO CREATE TABLE [dbo].[DataBase_Photo]( [PhotoId] [nvarchar](50) NOT NULL, [ProjectId] [nvarchar](50) NULL, [PhotoType] [nvarchar](100) NULL, [Date] [datetime] NULL, [Place] [nvarchar](50) NULL, [Person] [nvarchar](50) NULL, [Subject] [nvarchar](200) NULL, [Background] [nvarchar](100) NULL, [Photographer] [nvarchar](50) NULL, [AttachUrl] [nvarchar](1000) NULL, CONSTRAINT [PK_DataBase_Photo] PRIMARY KEY CLUSTERED ( [PhotoId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'PhotoId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'ProjectId' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'照片类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'PhotoType' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'Date' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'地点' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'Place' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'人物' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'Person' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'事由' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'Subject' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'背景' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'Background' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'摄影者' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'Photographer' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'附件路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo', @level2type=N'COLUMN',@level2name=N'AttachUrl' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'声像资料表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo' GO