SGGL_HBAZ/DataBase/版本日志/SGGLDB_V2025-03-10-001-gaof...

20 lines
1.1 KiB
Transact-SQL

ALTER VIEW [dbo].[View_QuantityManagement_Base]
AS
/********¹¤³ÌÁ¿»ù´¡±í********/
select BaseId,C.ProjectId,C.DrawingId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,case when a.DrawingNo is not null then a.DrawingNo else b.ChangeNo end as DrawingNo,
case when a.DrawingName is not null then a.DrawingName else b.ChangeName end as DrawingName,C.State,
case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major,
Part,ProjectContent,Unit,Amount,t.TeamGroupName as WorkTeam
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
left join ProjectData_TeamGroup t on t.TeamGroupId=C.WorkTeam
GO