89 lines
3.7 KiB
MySQL
89 lines
3.7 KiB
MySQL
|
|
|||
|
CREATE TABLE [dbo].[ProcessControl_InspectionManagementDetail](
|
|||
|
[InspectionDetailId] [nvarchar](50) NOT NULL,
|
|||
|
[InspectionId] [nvarchar](50) NULL,
|
|||
|
[UnitWorkId] [nvarchar](50) NULL,
|
|||
|
[Branch] [nvarchar](50) NULL,
|
|||
|
[ControlPointType] [nvarchar](50) NULL,
|
|||
|
[CreateDate] [datetime] NULL,
|
|||
|
CONSTRAINT [PK_ProcessControl_InspectionManagementDetail] PRIMARY KEY CLUSTERED
|
|||
|
(
|
|||
|
[InspectionDetailId] 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_InspectionManagementDetail] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_InspectionManagementDetail_ProcessControl_InspectionManagement] FOREIGN KEY([InspectionId])
|
|||
|
REFERENCES [dbo].[ProcessControl_InspectionManagement] ([InspectionId])
|
|||
|
GO
|
|||
|
|
|||
|
ALTER TABLE [dbo].[ProcessControl_InspectionManagementDetail] CHECK CONSTRAINT [FK_ProcessControl_InspectionManagementDetail_ProcessControl_InspectionManagement]
|
|||
|
GO
|
|||
|
|
|||
|
ALTER TABLE [dbo].[ProcessControl_InspectionManagementDetail] WITH CHECK ADD CONSTRAINT [FK_ProcessControl_InspectionManagementDetail_WBS_UnitWork] FOREIGN KEY([UnitWorkId])
|
|||
|
REFERENCES [dbo].[WBS_UnitWork] ([UnitWorkId])
|
|||
|
GO
|
|||
|
|
|||
|
ALTER TABLE [dbo].[ProcessControl_InspectionManagementDetail] CHECK CONSTRAINT [FK_ProcessControl_InspectionManagementDetail_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_InspectionManagementDetail', @level2type=N'COLUMN',@level2name=N'InspectionDetailId'
|
|||
|
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_InspectionManagementDetail', @level2type=N'COLUMN',@level2name=N'InspectionId'
|
|||
|
GO
|
|||
|
|
|||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagementDetail', @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_InspectionManagementDetail', @level2type=N'COLUMN',@level2name=N'Branch'
|
|||
|
GO
|
|||
|
|
|||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'<EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD>Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProcessControl_InspectionManagementDetail', @level2type=N'COLUMN',@level2name=N'ControlPointType'
|
|||
|
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_InspectionManagementDetail', @level2type=N'COLUMN',@level2name=N'CreateDate'
|
|||
|
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_InspectionManagementDetail'
|
|||
|
GO
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
CREATE VIEW [dbo].[View_CQMS_InspectionManagementDetail]
|
|||
|
AS
|
|||
|
/********<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD>********/
|
|||
|
SELECT Detail.InspectionDetailId,
|
|||
|
Detail.InspectionId,
|
|||
|
Detail.UnitWorkId,
|
|||
|
Detail.Branch,
|
|||
|
Detail.ControlPointType,
|
|||
|
Detail.CreateDate,
|
|||
|
IM.ProjectId,
|
|||
|
IM.UnitId,
|
|||
|
IM.CNProfessionalId,
|
|||
|
IM.InspectionCode,
|
|||
|
IM.AcceptanceSite,
|
|||
|
IM.IsOnceQualified,
|
|||
|
IM.InspectionDate,
|
|||
|
IM.AttachUrl,
|
|||
|
IM.CheckDate,
|
|||
|
IM.CheckMan,
|
|||
|
IM.UnqualifiedReason,
|
|||
|
IM.NoticeCode,
|
|||
|
IM.AcceptanceCheckMan,
|
|||
|
IM.ParentDivisionProjectId,
|
|||
|
IM.CompileMan,
|
|||
|
IM.CompileDate,
|
|||
|
IM.FileType,
|
|||
|
IM.AttachUrl2
|
|||
|
FROM dbo.ProcessControl_InspectionManagementDetail AS Detail
|
|||
|
LEFT JOIN ProcessControl_InspectionManagement AS IM ON IM.InspectionId=Detail.InspectionId
|
|||
|
|
|||
|
|
|||
|
GO
|
|||
|
|
|||
|
|