20251218 施工图核查记录
This commit is contained in:
@@ -0,0 +1,316 @@
|
||||
insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuModule)
|
||||
values('E6221F7D-9A68-44FB-974D-6857EC9CC5E8','施工图核查记录','JGZL/ConDrawingVerification.aspx',50,'2A84FA58-8B20-48ED-A621-3EC98CF4AD28','3')
|
||||
go
|
||||
insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
values('80F4137C-D4F5-48E6-B649-A7696A8E84A0','E6221F7D-9A68-44FB-974D-6857EC9CC5E8','增加',1)
|
||||
insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
values('D38E66DC-8464-4B6D-8927-0C446732C386','E6221F7D-9A68-44FB-974D-6857EC9CC5E8','修改',2)
|
||||
insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
values('A76B70C1-D6B4-4472-BCF6-93EBBFB23C94','E6221F7D-9A68-44FB-974D-6857EC9CC5E8','删除',3)
|
||||
insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
values('DD03E8F8-6FF6-4700-A932-DB6F0A943180','E6221F7D-9A68-44FB-974D-6857EC9CC5E8','保存',4)
|
||||
go
|
||||
|
||||
|
||||
CREATE TABLE [dbo].[JGZL_ConDrawingVerification](
|
||||
[ConDrawingVerificationId] [nvarchar](50) NOT NULL,
|
||||
[ProjectId] [nvarchar](50) NULL,
|
||||
[DesignUnit] [nvarchar](50) NULL,
|
||||
[Professional] [nvarchar](50) NULL,
|
||||
[Host] [nvarchar](50) NULL,
|
||||
[VerificationDate] [datetime] NULL,
|
||||
[ConDrawingCode] [nvarchar](50) NULL,
|
||||
[Personnel] [nvarchar](2000) NULL,
|
||||
[Contents] [nvarchar](2000) NULL,
|
||||
[Problems] [nvarchar](2000) NULL,
|
||||
[Recorder] [nvarchar](50) NULL,
|
||||
[RecordDate] [datetime] NULL,
|
||||
[Reviewer] [nvarchar](50) NULL,
|
||||
[ReviewDate] [datetime] NULL,
|
||||
[CompileMan] [nvarchar](50) NULL,
|
||||
[CompileDate] [datetime] NULL,
|
||||
CONSTRAINT [PK_JGZL_ConDrawingVerification] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[ConDrawingVerificationId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[JGZL_ConDrawingVerification] WITH CHECK ADD CONSTRAINT [FK_JGZL_ConDrawingVerification_Base_Project] FOREIGN KEY([ProjectId])
|
||||
REFERENCES [dbo].[Base_Project] ([ProjectId])
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[JGZL_ConDrawingVerification] CHECK CONSTRAINT [FK_JGZL_ConDrawingVerification_Base_Project]
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[JGZL_ConDrawingVerification] WITH CHECK ADD CONSTRAINT [FK_JGZL_ConDrawingVerification_Sys_User] FOREIGN KEY([CompileMan])
|
||||
REFERENCES [dbo].[Sys_User] ([UserId])
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[JGZL_ConDrawingVerification] CHECK CONSTRAINT [FK_JGZL_ConDrawingVerification_Sys_User]
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'ConDrawingVerificationId'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @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'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'DesignUnit'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专业' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'Professional'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主持人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'Host'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'核查时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'VerificationDate'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'施工图号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'ConDrawingCode'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'参加核查人员' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'Personnel'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容记录' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'Contents'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问题情况' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'Problems'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'Recorder'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'RecordDate'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'Reviewer'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @level2type=N'COLUMN',@level2name=N'ReviewDate'
|
||||
GO
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编制人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'JGZL_ConDrawingVerification', @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'JGZL_ConDrawingVerification', @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'JGZL_ConDrawingVerification'
|
||||
GO
|
||||
|
||||
|
||||
ALTER PROCEDURE [dbo].[HJGL_sp_rpt_NDTReport]
|
||||
(
|
||||
@ProjectId NVARCHAR(50) = null,
|
||||
@trustDate datetime = null
|
||||
)
|
||||
AS
|
||||
/***************无损检测日报**********************/
|
||||
SELECT NDTType.NDT_ID,
|
||||
Base_Project.ProjectCode AS ProjectCode,--施工号
|
||||
Base_Project.ProjectName AS ProjectName,--项目名称
|
||||
NDTType.NDT_Code,--检测方式
|
||||
ISNULL(need_check_count.need_check_count,0) as need_check_count,--需检测焊口总数(合计)
|
||||
ISNULl(trust_count_current.trust_count_current,0) as trust_count_current,--当日委托焊口
|
||||
ISNULL(trust_count_total.trust_count_total,0) as trust_count_total,--累计委托焊口
|
||||
ISNULL(check_count_current.check_count_current,0) as check_count_current,--当日检测焊口
|
||||
ISNULL(check_count.check_count,0) as check_count,--累计检测焊口数
|
||||
ISNULL(total_check_Pass_count.total_check_Pass_count,0) as total_check_Pass_count,--累计合格焊口数
|
||||
ISNULL(check_count_film.check_count_film,0) AS check_count_film,--累计检测片数
|
||||
--ISNULL(check_count_Pass_film.check_count_Pass_film,0) as check_count_Pass_film,--累计合格片数
|
||||
(ISNULL(check_count_film.check_count_film,0)-ISNULL(repair_total_film.repair_total_film,0))as check_count_Pass_film,
|
||||
|
||||
CONVERT(nvarchar(10),CAST(CAST((CASE ISNULL(need_check_count.need_check_count,0) WHEN 0 THEN 0
|
||||
ELSE 1.0 * ISNULL(check_count.check_count,0)/(1.0 * need_check_count.need_check_count) END) AS DECIMAL(19,3))*100 as DECIMAL(19,1)) )+'%'
|
||||
AS complated_check_rate, --完成检测比例(焊口数) 累计检测焊口数/需检测焊口总数
|
||||
|
||||
CONVERT(nvarchar(10),CAST(CAST((CASE ISNULL(check_count.check_count,0) WHEN 0 THEN 0
|
||||
ELSE 1.0 * ISNULL(one_check_Pass_count.one_check_Pass_count,0)/(1.0 * check_count.check_count) END) AS DECIMAL(19,3))*100 as DECIMAL(19,1)) )+'%'
|
||||
AS check_onePass_rate,--检测一次合格率(焊口数) 累计合格焊口数/累计检测焊口数
|
||||
|
||||
--CONVERT(nvarchar(10),CAST(CAST((CASE ISNULL(check_count_film.check_count_film,0) WHEN 0 THEN 0
|
||||
-- ELSE 1.0 * ISNULL(check_count_Pass_film.check_count_Pass_film,0)/(1.0 * check_count_film.check_count_film) END) AS DECIMAL(19,3))*100 as DECIMAL(19,1)) )+'%'
|
||||
-- AS check_onePass_film_rate,--检测一次合格率(片数) 累计合格片数/累计检测片数
|
||||
--CONVERT(nvarchar(10),CAST(CAST((CASE ISNULL(check_count_film.check_count_film,0) WHEN 0 THEN 0
|
||||
-- ELSE 1.0 * ISNULL(one_check_Pass_film.one_check_Pass_film,0)/(1.0 * check_count_film.check_count_film) END) AS DECIMAL(19,3))*100 as DECIMAL(19,1)) )+'%'
|
||||
-- AS check_onePass_film_rate,--检测一次合格率(片数) 一次合格片数/累计检测片数
|
||||
|
||||
CONVERT(nvarchar(10),CAST(CAST((CASE ISNULL(check_count_film.check_count_film,0) WHEN 0 THEN 0
|
||||
ELSE 1.0 * (ISNULL(check_count_film.check_count_film,0)-ISNULL(repair_total_film.repair_total_film,0))/(1.0 * check_count_film.check_count_film) END) AS DECIMAL(19,3))*100 as DECIMAL(19,1)) )+'%'
|
||||
AS check_onePass_film_rate,--检测一次合格率(片数) 累计合格片数/累计检测片数
|
||||
|
||||
(isnull(check_count.check_count,0) - isnull(total_check_Pass_count.total_check_Pass_count,0)) AS check_noPass_count,--累计检测不合格数(焊口数) 累计检测焊口数-累计合格焊口数
|
||||
--(isnull(check_NoPass_count.check_NoPass_count,0)) as check_noPass_count,--累计检测不合格数(焊口数)
|
||||
|
||||
(ISNULL(check_count_film.check_count_film,0) - (ISNULL(check_count_film.check_count_film,0)-ISNULL(repair_total_film.repair_total_film,0))) as check_noPass_film_count,--累计检测不合格数(片数) 累计检测片数-累计合格片数
|
||||
--ISNULL(check_count_NoPass_film.check_count_NoPass_film,0) as check_noPass_film_count,--累计检测不合格数(片数)
|
||||
|
||||
ISNULL(repair_current_film.repair_current_film,0) AS repair_current_film,--焊缝返修情况(片数)(当日完成)
|
||||
|
||||
ISNULL(repair_total_film.repair_total_film,0) AS repair_total_film,--焊缝返修情况(片数)(累计完成)
|
||||
|
||||
--(ISNULl(check_count_film.check_count_film,0) - isnull(check_count_Pass_film.check_count_Pass_film,0))-ISNULL(repair_total_film.repair_total_film,0) as pending_repair_film, --焊缝返修情况(片数) 待返修 (累计检测不合格数(片数)- 焊缝返修情况(片数)(累计完成))
|
||||
--(ISNULL(check_count_NoPass_film.check_count_NoPass_film,0) - ISNULL(repair_total_film.repair_total_film,0)) as pending_repair_film,
|
||||
isnull(repair_film.repair_film,0) as pending_repair_film,--待返修片数
|
||||
|
||||
isnull(repair_current_count.repair_current_count,0) as repair_current_count,--焊缝返修情况(焊口数)当日完成
|
||||
|
||||
isnull(repair_total_count.repair_total_count,0) as repair_total_count, --焊缝返修情况(焊口数)累计完成
|
||||
--(isnull(check_count.check_count,0) - isnull(total_check_Pass_count.total_check_Pass_count,0))-isnull(repair_total_count.repair_total_count,0) as pending_repair_count --焊缝返修情况(焊口数)待返修 (累计检测不合格数(焊口)-焊缝返修情况(焊口数)累计完成)
|
||||
isnull(repair_count.repair_count,0) as pending_repair_count
|
||||
FROM HJGL_BS_NDTType AS NDTType
|
||||
LEFT JOIN Base_Project ON Base_Project.ProjectId=@ProjectId
|
||||
--需检测焊口总数
|
||||
LEFT JOIN (SELECT COUNT(*) AS need_check_count,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS need_check_count ON need_check_count.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--当日委托焊口
|
||||
LEFT JOIN (SELECT COUNT(*) AS trust_count_current,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId AND CONVERT(varchar(10), HJGL_CH_Trust.CH_TrustDate,120)=@trustDate
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS trust_count_current ON trust_count_current.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--累计委托焊口
|
||||
LEFT JOIN (SELECT COUNT(*) AS trust_count_total,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS trust_count_total ON trust_count_total.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--当日检测焊口数
|
||||
LEFT JOIN (SELECT COUNT(*) AS check_count_current,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_TrustItem.States!='1'
|
||||
AND HJGL_CH_Trust.ProjectId=@ProjectId AND CONVERT(varchar(10), HJGL_CH_Trust.CH_TrustDate,120)=@trustDate
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_count_current ON check_count_current.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--累计检测焊口数
|
||||
LEFT JOIN (SELECT COUNT(*) AS check_count,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_TrustItem.States!='1' and HJGL_PW_JointInfo.PointType='点口'
|
||||
AND HJGL_CH_Trust.ProjectId=@ProjectId
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_count ON check_count.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--累计合格焊口数
|
||||
LEFT JOIN (SELECT COUNT(*) AS total_check_Pass_count,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId AND HJGL_CH_TrustItem.States='2' and HJGL_PW_JointInfo.PointType='点口'
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS total_check_Pass_count ON total_check_Pass_count.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
|
||||
----累计检测片数
|
||||
LEFT JOIN (SELECT COUNT(*) AS check_count_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRating
|
||||
LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_BO_QualityRating.CH_TrustItemID
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId and HJGL_CH_TrustItem.States!='1' and HJGL_PW_JointInfo.PointType='点口'
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_count_film ON check_count_film.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--累计一次合格焊口数
|
||||
LEFT JOIN (SELECT COUNT(*) AS one_check_Pass_count,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId AND HJGL_CH_TrustItem.States='2' and HJGL_PW_JointInfo.PointType='点口'
|
||||
and HJGL_CH_TrustItem.JOT_ID not in (select JOT_ID from HJGL_CH_Repair)
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS one_check_Pass_count ON one_check_Pass_count.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--累计一次合格片数
|
||||
LEFT JOIN (SELECT COUNT(*) AS one_check_Pass_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRating
|
||||
LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_BO_QualityRating.CH_TrustItemID
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId AND HJGL_CH_TrustItem.States='2' and HJGL_PW_JointInfo.PointType='点口'
|
||||
and HJGL_CH_TrustItem.JOT_ID not in (select JOT_ID from HJGL_CH_Repair)
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS one_check_Pass_film ON one_check_Pass_film.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--累计检测不合格数
|
||||
--LEFT JOIN (SELECT COUNT(*) AS check_NoPass_count,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem
|
||||
-- LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
-- left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
-- WHERE HJGL_CH_Trust.ProjectId=@ProjectId AND HJGL_CH_TrustItem.JOT_ID in (select JOT_ID from HJGL_CH_Repair)
|
||||
-- and HJGL_PW_JointInfo.PointType='点口'
|
||||
-- GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_NoPass_count ON check_NoPass_count.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--累计合格片数
|
||||
--LEFT JOIN (SELECT COUNT(*) AS check_count_Pass_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRating
|
||||
-- LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_BO_QualityRating.CH_TrustItemID
|
||||
-- LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
-- left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
-- WHERE HJGL_BO_QualityRating.IsPass='合格' and HJGL_CH_Trust.ProjectId=@ProjectId and HJGL_PW_JointInfo.PointType='点口'
|
||||
-- GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_count_Pass_film ON check_count_Pass_film.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--累计不合格片数
|
||||
LEFT JOIN (SELECT COUNT(*) AS check_count_NoPass_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRating
|
||||
LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_BO_QualityRating.CH_TrustItemID
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_BO_QualityRating.IsPass='不合格' and HJGL_CH_Trust.ProjectId=@ProjectId and HJGL_PW_JointInfo.PointType='点口'
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_count_NoPass_film ON check_count_NoPass_film.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--焊缝返修情况(片数)(当日完成)
|
||||
LEFT JOIN (SELECT COUNT(*) AS repair_current_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRatingRepair
|
||||
LEFT JOIN HJGL_CH_RepairItem ON HJGL_CH_RepairItem.CH_RepairItemId = HJGL_BO_QualityRatingRepair.CH_RepairItemId
|
||||
LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID
|
||||
LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId AND CONVERT(varchar(10),HJGL_CH_Repair.RepairTrustDate,120)=@trustDate
|
||||
and HJGL_PW_JointInfo.PointType='点口'
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS repair_current_film ON repair_current_film.CH_NDTMethod = NDTType.NDT_ID
|
||||
|
||||
--焊缝返修情况(片数)(累计完成)
|
||||
LEFT JOIN (SELECT COUNT(*) AS repair_total_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRatingRepair
|
||||
LEFT JOIN HJGL_CH_RepairItem ON HJGL_CH_RepairItem.CH_RepairItemId = HJGL_BO_QualityRatingRepair.CH_RepairItemId
|
||||
LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID
|
||||
LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId and HJGL_PW_JointInfo.PointType='点口'
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS repair_total_film ON repair_total_film.CH_NDTMethod = NDTType.NDT_ID
|
||||
--待返修(片数)
|
||||
LEFT JOIN (SELECT COUNT(*) AS repair_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRatingRepair
|
||||
LEFT JOIN HJGL_CH_RepairItem ON HJGL_CH_RepairItem.CH_RepairItemId = HJGL_BO_QualityRatingRepair.CH_RepairItemId
|
||||
LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID
|
||||
LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID
|
||||
LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Trust.ProjectId=@ProjectId and HJGL_CH_RepairItem.States='4'and HJGL_PW_JointInfo.PointType='点口'
|
||||
GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS repair_film ON repair_film.CH_NDTMethod = NDTType.NDT_ID
|
||||
--焊缝返修情况(焊口数) 当日完成
|
||||
left join (select count(*) as repair_current_count,HJGL_CH_Repair.NDT_ID from HJGL_CH_RepairItem
|
||||
LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID
|
||||
LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_RepairItem.States='4' AND HJGL_CH_Repair.ProjectId=@ProjectId AND CONVERT(varchar(10),HJGL_CH_Repair.RepairTrustDate,120)=@trustDate
|
||||
and HJGL_PW_JointInfo.PointType='点口'
|
||||
GROUP BY HJGL_CH_Repair.NDT_ID) as repair_current_count on repair_current_count.NDT_ID =NDTType.NDT_ID
|
||||
|
||||
--焊缝返修情况(焊口数) 累计完成
|
||||
left join (select count(*) as repair_total_count,HJGL_CH_Repair.NDT_ID from HJGL_CH_RepairItem
|
||||
LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID
|
||||
LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Repair.ProjectId=@ProjectId and HJGL_PW_JointInfo.PointType='点口'
|
||||
GROUP BY HJGL_CH_Repair.NDT_ID) as repair_total_count on repair_total_count.NDT_ID =NDTType.NDT_ID
|
||||
|
||||
--焊缝返修情况(焊口数) 待返修
|
||||
left join (select count(*) as repair_count,HJGL_CH_Repair.NDT_ID from HJGL_CH_RepairItem
|
||||
LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID
|
||||
LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID
|
||||
left join HJGL_PW_JointInfo on HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID
|
||||
WHERE HJGL_CH_Repair.ProjectId=@ProjectId and HJGL_CH_RepairItem.States='4' and HJGL_PW_JointInfo.PointType='点口'
|
||||
GROUP BY HJGL_CH_Repair.NDT_ID) as repair_count on repair_count.NDT_ID =NDTType.NDT_ID
|
||||
|
||||
GO
|
||||
|
||||
|
||||
Reference in New Issue
Block a user