317 lines
22 KiB
Transact-SQL
317 lines
22 KiB
Transact-SQL
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
|
|
|
|
|