SGGL_SHJ/DataBase/版本日志/SGGLDB_V2023-11-28.sql

23 lines
2.4 KiB
Transact-SQL

alter table WBS_WorkPackage add DrawProjectQuantity decimal(18,2) null
GO
ALTER VIEW [dbo].[View_WBS]
AS
select '1' as Id,'0' as SupId ,'JZ' as Code, '½¨Öþ¹¤³Ì' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,null as RealEndDate,null as WBSCode,null as JDWeights,null as Unit,null as PlanProjectQuantity,null as RealProjectQuantity,null as RealStartDate,null as IsMileStone,null as PlanCost,null as PreWorkCode,'' as ShowId,null as DrawProjectQuantity,
ProjectId from dbo.Base_Project
Union
select '2' as Id,'0' as SupId ,'AZ' as Code, '°²×°¹¤³Ì' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,null as RealEndDate,null as WBSCode,null as JDWeights,null as Unit,null as PlanProjectQuantity,null as RealProjectQuantity,null as RealStartDate,null as IsMileStone,null as PlanCost,null as PreWorkCode,'' as ShowId,null as DrawProjectQuantity,
ProjectId from dbo.Base_Project
Union
select UnitWorkId as Id,ProjectType as SupId ,UnitWorkCode as Code, UnitWorkName as Name,'UnitWork' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode,JDWeights,null as Unit,null as PlanProjectQuantity,null as RealProjectQuantity,RealStartDate,null as IsMileStone,PlanCost,null as PreWorkCode,'' as ShowId,null as DrawProjectQuantity,
ProjectId from dbo.WBS_UnitWork
Union all
select WorkPackageId as id,UnitWorkId as SupId,WorkPackageCode as Code,PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode,JDWeights,Unit,PlanProjectQuantity,RealProjectQuantity,RealStartDate,IsMileStone,PlanCost,PreWorkCode,case when (select COUNT(*) from WBS_WorkPackage a where a.SuperWorkPackageId=w.WorkPackageId and a.IsApprove=1)=0 then WorkPackageId else '' end as ShowId,DrawProjectQuantity,
ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is null
Union all
select WorkPackageId as id,SuperWorkPackageId as SupId,WorkPackageCode as Code, PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode,JDWeights,Unit,PlanProjectQuantity,RealProjectQuantity,RealStartDate,IsMileStone,PlanCost,PreWorkCode,case when (select COUNT(*) from WBS_WorkPackage a where a.SuperWorkPackageId=w.WorkPackageId and a.IsApprove=1)=0 then WorkPackageId else '' end as ShowId,DrawProjectQuantity,
ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is not null
GO