CNCEC_SUBQHSE_WUHUAN/DataBase/版本日志/已更新脚本/SGGLDB_V2020-12-07-001.sql

859 lines
44 KiB
MySQL
Raw Normal View History

2021-04-30 10:28:37 +08:00
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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ŀ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'<EFBFBD><EFBFBD>λ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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ԫ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'<EFBFBD>ֲ<EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD>ղ<EFBFBD>λ' , @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'<EFBFBD>Ƿ<EFBFBD>һ<EFBFBD>κϸ<EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD>ߺ<EFBFBD> ' , @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'<EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'Ӳ<EFBFBD>ȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ŀ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'<EFBFBD><EFBFBD>Ԫ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'<EFBFBD><EFBFBD>λ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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'Ƭ<EFBFBD><EFBFBD>' , @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'һ<EFBFBD>κϸ<EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ŀ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'<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>' , @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'<EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>1-<2D><><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>2-δ<><CEB4><EFBFBD>ɣ<EFBFBD>' , @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'<EFBFBD><EFBFBD>ע' , @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'<EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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, --<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD>
P.ProjectName, --<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I.UnitId,
U.UnitName, --ʩ<EFBFBD><EFBFBD><EFBFBD>ְ<EFBFBD><EFBFBD><EFBFBD>
I.InspectionCode, --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I.CompileMan,
Users.UserName,--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I.CompileDate,
I.UnitWorkId,
UnitWork.UnitWorkName,--<EFBFBD><EFBFBD>Ԫ
DivisionProject.DivisionName AS Branch, --<EFBFBD>ֲ<EFBFBD>
BreakdownProject.BreakdownName AS ControlPointType, --<EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BreakdownProject.Class,--<EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD>ȼ<EFBFBD>
BreakdownProject.Basis,--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I.AcceptanceSite, --<EFBFBD><EFBFBD><EFBFBD>ղ<EFBFBD>λ
I.InspectionDate --ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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','<EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><EFBFBD><EFBFBD>','',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','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD>','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','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('302edae2-b68f-4bff-b1a4-65e98bba18e9','4781f467-35bf-4cf2-aaa4-7960a175eb61','<EFBFBD>޸<EFBFBD>',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('febb75b4-bd83-4845-93e1-2e8d39a72897','4781f467-35bf-4cf2-aaa4-7960a175eb61','ɾ<EFBFBD><EFBFBD>',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('72d8ac60-47f6-401a-8eaf-9ed6356a1ff4','4781f467-35bf-4cf2-aaa4-7960a175eb61','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',4)
GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('e728cc1a-fd65-4f1a-8f22-2b72e62f78ee','<EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','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','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('864d7245-09d8-46d2-a945-0d1e0743fd09','e728cc1a-fd65-4f1a-8f22-2b72e62f78ee','<EFBFBD>޸<EFBFBD>',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('167dd775-ad22-44eb-ba18-f3b9437f4f84','e728cc1a-fd65-4f1a-8f22-2b72e62f78ee','ɾ<EFBFBD><EFBFBD>',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('9e43ed04-c287-4702-a951-41b2bdcfd46d','e728cc1a-fd65-4f1a-8f22-2b72e62f78ee','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',4)
GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('d563d7a9-e574-4e25-b868-a124aa789789','<EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD>','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','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('ec944e22-8b23-4dc4-9b06-738f144d020a','d563d7a9-e574-4e25-b868-a124aa789789','<EFBFBD>޸<EFBFBD>',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('baf49264-7a99-4870-82a4-ce523ab83afb','d563d7a9-e574-4e25-b868-a124aa789789','ɾ<EFBFBD><EFBFBD>',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('02343af9-4fc9-43ab-adb2-9b529fdab3cf','d563d7a9-e574-4e25-b868-a124aa789789','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',4)
GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('ec1d25f6-fc6d-4b76-877d-d545669b21c9','<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','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','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('c3eb249b-5df9-4754-abb1-1bd69b1949a6','ec1d25f6-fc6d-4b76-877d-d545669b21c9','<EFBFBD>޸<EFBFBD>',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('87bfc2cf-6860-4b84-91c1-33b703df5d8a','ec1d25f6-fc6d-4b76-877d-d545669b21c9','ɾ<EFBFBD><EFBFBD>',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('bbc795b7-39a9-4f11-8bc4-9eeda3dea4b7','ec1d25f6-fc6d-4b76-877d-d545669b21c9','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',4)
GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('e6b18529-5d1b-4fde-bdab-7354b996e5de','<EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','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','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('45f19388-bf89-4c77-8078-96ceaf0dabaf','e6b18529-5d1b-4fde-bdab-7354b996e5de','<EFBFBD>޸<EFBFBD>',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('cb181257-407d-4e19-b866-f91ad792e465','e6b18529-5d1b-4fde-bdab-7354b996e5de','ɾ<EFBFBD><EFBFBD>',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('4d573638-cd56-43c0-89bb-1d4ae19e1c72','e6b18529-5d1b-4fde-bdab-7354b996e5de','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',4)
GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('6177c436-5cc7-4ed9-929c-6b7d2082fd28','<EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','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','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('133be610-d43f-42ba-8485-b203005e4857','6177c436-5cc7-4ed9-929c-6b7d2082fd28','<EFBFBD>޸<EFBFBD>',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('b88219ef-e618-4f4a-b47f-30422fa70032','6177c436-5cc7-4ed9-929c-6b7d2082fd28','ɾ<EFBFBD><EFBFBD>',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('4afaf68c-85d7-4b1b-adae-afef2d137518','6177c436-5cc7-4ed9-929c-6b7d2082fd28','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',4)
GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('3e0bf9b3-b497-4627-b93c-367dd60f901d','<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD>','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','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('a3f3c18a-aad7-4e1e-8ca2-955977c27e84','3e0bf9b3-b497-4627-b93c-367dd60f901d','<EFBFBD>޸<EFBFBD>',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('c5e700dd-cdfa-4aae-a83c-b8ca3a9eb397','3e0bf9b3-b497-4627-b93c-367dd60f901d','ɾ<EFBFBD><EFBFBD>',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)VALUES('070cfa03-6fb4-4eb9-aaa1-568d26abdb4d','3e0bf9b3-b497-4627-b93c-367dd60f901d','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ŀ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'<EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ԫ' , @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'<EFBFBD><EFBFBD>λ' , @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'<EFBFBD><EFBFBD>ע' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ŀ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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>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'<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'ҳ<EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>ע' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>ӦWBSʱ<EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD>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'<EFBFBD><EFBFBD>ӦWBSʱ<EFBFBD>ķֲ<EFBFBD>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'<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_File'
GO
CREATE VIEW [dbo].[View_DataBaseProject]
AS
--<EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>׹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SELECT D.DesignDetailsId AS DataBaseId --id
,D.ProjectId --<EFBFBD><EFBFBD>Ŀid
,'' as UnitId
,D.CNProfessionalId --רҵid
,D.DesignDetailsCode AS FileCode --<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
, I.UnitWorkName AS FileNames --<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
,'ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>׹<EFBFBD><EFBFBD><EFBFBD>' AS FileType
,D.CompileDate AS Dates --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
,U.UserName AS Man --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
,D.AttachUrl AS Url --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
,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
--<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SELECT I.InspectionPersonId AS DataBaseId
,I.ProjectId
,I.UnitId
,I.CNProfessionalId
,I.InspectionPersonCode AS FileCode
,I.PersonName AS FileNames
,'ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>' 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
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¹ʴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>
SELECT Q.QualityAccidentId AS DataBaseId --id
,Q.ProjectId
,Q.UnitId
,'' AS CNProfessionalId
,'' AS FileCode
,(T.UnitName + Q.Place) AS FileNames
,'רҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¹ʴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' 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
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD><EFBFBD><EFBFBD>
SELECT I.InspectionEquipmentId AS DataBaseId
,I.ProjectId
,I.UnitId
,I.CNProfessionalId
,I.InspectionCode AS FileCode
,I.InspectionName AS FileNames
,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SH/T 3903-A9<41><39>' 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 '%<25>廷%'
UNION
-- һ<><EFBFBD><E3B7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SELECT G.GeneralPlanApprovalId AS DataBaseId
,G.ProjectId
,G.UnitId
,G.CNProfessionalId
,G.PlanCode AS FileCode
,G.PlanName AS FileNames
,'ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>' 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
--<EFBFBD>ش󷽰<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SELECT M.MajorPlanApprovalId AS DataBaseId
,M.ProjectId
,M.UnitId
,M.CNProfessionalId
,M.PlanCode AS FileCode
,M.PlanName AS FileNames
,'ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>' 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
--<EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>
SELECT I.InspectionMachineId AS DataBaseId
,I.ProjectId
,I.UnitId
,I.CNProfessionalId
,I.InspectionMachineCode AS FileCode
,I.InspectionMachineName AS FileNames
,'ʩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߺͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>' 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
--<EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD>
SELECT D.DesignChangeOrderId AS DataBaseId
,D.ProjectId
,'' as UnitId
,D.CNProfessionalId
,D.ChangeOrderCode AS FileCode
,D.ChangeReason AS FileNames
,'רҵ<EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>' 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
--<EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD>
SELECT D.DesignDetailsId AS DataBaseId
,D.ProjectId
,D.UnitName as UnitId
,D.CNProfessionalId
,D.DesignDetailsCode AS FileCode
,'<EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>׹<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>' AS FileNames
,'<EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼֽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ' 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 --<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
,I.NoticeCode AS FileName --<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
,'' 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 --<EFBFBD><EFBFBD>Ԫ
,C.ProfessionalName --רҵ
,D.DivisionName --<EFBFBD>ֲ<EFBFBD>
,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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ŀ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'<EFBFBD><EFBFBD>Ƭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'ʱ<EFBFBD><EFBFBD>' , @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'<EFBFBD>ص<EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD>Ӱ<EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>' , @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'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataBase_Photo'
GO