提交代码

This commit is contained in:
2025-05-06 15:04:17 +08:00
parent fe0745c4d7
commit 3b18178e30
15 changed files with 714 additions and 27458 deletions
@@ -0,0 +1,57 @@
ALTER VIEW [dbo].[View_QuantityManagement_WorkTeamStatistics]
AS
/********工程量整体及分类汇总表********/
select distinct C.ProjectId+','+(case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end)+','+ProjectContent as Id, C.ProjectId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,ba.State,
ProjectContent,Unit,
case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major
from QuantityManagement_DayInput C
left join QuantityManagement_Base ba on ba.BaseId=C.BaseId
left join QuantityManagement_Drawing a on a.DrawingId=ba.DrawingId
left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major
left join QuantityManagement_Change b on b.ChangeId=ba.DrawingId
left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major
union
select C.ProjectId+','+(case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end)+','+ProjectContent as Id,C.ProjectId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,C.State,
ProjectContent,Unit,
case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major
from QuantityManagement_Base C
left join QuantityManagement_Drawing a on a.DrawingId=C.DrawingId
left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major
left join QuantityManagement_Change b on b.ChangeId=C.DrawingId
left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major
GO
ALTER VIEW [dbo].[View_QuantityManagement_ProjectContentStatistics]
AS
/********工程量整体及分类汇总表********/
select distinct C.ProjectId+','+ProjectContent as Id, C.ProjectId,ba.State,
ProjectContent,Unit,case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major
from QuantityManagement_DayInput C
left join QuantityManagement_Base ba on ba.BaseId=C.BaseId
left join QuantityManagement_Drawing a on a.DrawingId=ba.DrawingId
left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major
left join QuantityManagement_Change b on b.ChangeId=ba.DrawingId
left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major
union
select C.ProjectId+','+ProjectContent as Id,C.ProjectId,C.State,
ProjectContent,Unit,case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major
from QuantityManagement_Base C
left join QuantityManagement_Drawing a on a.DrawingId=C.DrawingId
left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major
left join QuantityManagement_Change b on b.ChangeId=C.DrawingId
left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major
GO