0923-gaofei
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
|
||||
ALTER VIEW [dbo].[View_WBS_CostControlDetail]
|
||||
AS
|
||||
/********控制项明细********/
|
||||
SELECT detail.CostControlDetailId,
|
||||
detail.CostControlId,
|
||||
detail.Months,
|
||||
detail.StartDate,
|
||||
detail.EndDate,
|
||||
c.CostControlCode,
|
||||
c.CostControlName,
|
||||
c.WbsSetId,
|
||||
c.ProjectId,
|
||||
c.Unit, --单位
|
||||
c.TotalNum, --合同工作量
|
||||
CONVERT(FLOAT,(select sum(ISNULL(PlanNum,0)) from WBS_CostControlDetail where CostControlId=detail.CostControlId and Months<=detail.Months and StartDate is null)) as TotalPlanNum, --累计计划完成量
|
||||
CONVERT(FLOAT,(select sum(ISNULL(PlanNum,0)) from WBS_CostControlDetail where CostControlId=detail.CostControlId and ((Months<detail.Months and StartDate is null) or (Months=detail.Months and StartDate<=detail.StartDate)))) as TotalWeekPlanNum, --累计周计划完成量
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)) from WBS_CostControlDetail where CostControlId=detail.CostControlId and Months<=detail.Months)) as TotalThisNum, --累计完成量
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)) from WBS_CostControlDetail where CostControlId=detail.CostControlId and Months<=detail.Months and StartDate<=detail.StartDate)) as TotalWeekThisNum, --累计周完成量
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.PlanNum,0)) from WBS_CostControlDetail d
|
||||
where d.CostControlId=detail.CostControlId and Months=detail.Months and StartDate is null)) as PlanNum, --本月计划完成量
|
||||
CONVERT(FLOAT,ISNULL(detail.PlanNum,0)) as PlanWeekNum, --本周计划完成量
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.ThisNum,0)) from WBS_CostControlDetail d
|
||||
where d.CostControlId=detail.CostControlId and Months=detail.Months)) as ThisNum, --本月完成量
|
||||
CONVERT(FLOAT,ISNULL(detail.ThisNum,0)) as ThisWeekNum, --本周完成量
|
||||
c.RealPrice, --成本单价
|
||||
c.PlanPrice, --控制预算单价
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.PlanNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months=detail.Months and StartDate is null)) as ThisPlanValue, --本月计划完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.PlanNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months=detail.Months and StartDate=detail.StartDate)) as ThisWeekPlanValue, --本周计划完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.ThisNum,0)*ISNULL(c1.RealPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months=detail.Months)) as ThisRealCost, --本月实际成本
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.ThisNum,0)*ISNULL(c1.RealPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months=detail.Months and StartDate=detail.StartDate)) as ThisWeekRealCost, --本周实际成本
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months=detail.Months)) as ThisPlanCost, --本月完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months=detail.Months and StartDate=detail.StartDate)) as ThisWeekPlanCost, --本周完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.PlanNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months<=detail.Months and StartDate is null)) as TotalPlanValue, --累计计划完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.PlanNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and ((Months<detail.Months and StartDate is null) or (Months=detail.Months and StartDate<=detail.StartDate)))) as TotalWeekPlanValue, --累计周计划完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.ThisNum,0)*ISNULL(c1.RealPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months<=detail.Months)) as TotalRealCost, --累计完成成本
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.ThisNum,0)*ISNULL(c1.RealPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months<=detail.Months and (StartDate<=detail.StartDate or StartDate is null))) as TotalWeekRealCost, --累计周完成成本
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months<=detail.Months)) as TotalPlanCost, --累计完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
|
||||
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
|
||||
where d.CostControlId=detail.CostControlId and Months<=detail.Months and (StartDate<=detail.StartDate or StartDate is null))) as TotalWeekPlanCost --累计周完成预算
|
||||
FROM dbo.WBS_CostControlDetail AS detail
|
||||
LEFT JOIN WBS_CostControl AS c ON c.CostControlId=detail.CostControlId
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
ALTER VIEW [dbo].[View_WBS_CostControlParentDetail]
|
||||
AS
|
||||
/********控制项父级明细********/
|
||||
SELECT detail.CostControlParentDetailId,
|
||||
detail.ParentId,
|
||||
detail.Months,
|
||||
detail.StartDate,
|
||||
detail.EndDate,
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanValue,0)) from WBS_CostControlParentDetail
|
||||
where ParentId=detail.ParentId and Months=detail.Months)) as ThisPlanValue, --本月计划完成预算
|
||||
CONVERT(FLOAT,ISNULL(ThisPlanValue,0)) as ThisWeekPlanValue, --本周计划完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.ThisRealCost,0)) from WBS_CostControlParentDetail d
|
||||
where d.ParentId=detail.ParentId and Months=detail.Months)) as ThisRealCost, --本月实际成本
|
||||
CONVERT(FLOAT,ISNULL(ThisRealCost,0)) as ThisWeekRealCost, --本周实际成本
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanCost,0)) from WBS_CostControlParentDetail
|
||||
where ParentId=detail.ParentId and Months=detail.Months)) as ThisPlanCost, --本月完成预算
|
||||
CONVERT(FLOAT,ISNULL(ThisPlanCost,0)) as ThisWeekPlanCost, --本周完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanValue,0)) from WBS_CostControlParentDetail
|
||||
where ParentId=detail.ParentId and Months<=detail.Months)) as TotalPlanValue, --累计计划完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanValue,0)) from WBS_CostControlParentDetail
|
||||
where ParentId=detail.ParentId and Months<=detail.Months and (StartDate<=detail.StartDate or StartDate is null))) as TotalWeekPlanValue, --累计周计划完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.ThisRealCost,0)) from WBS_CostControlParentDetail d
|
||||
where d.ParentId=detail.ParentId and Months<=detail.Months)) as TotalRealCost, --累计完成成本
|
||||
CONVERT(FLOAT,(select sum(ISNULL(d.ThisRealCost,0)) from WBS_CostControlParentDetail d
|
||||
where d.ParentId=detail.ParentId and Months<=detail.Months and (StartDate<=detail.StartDate or StartDate is null))) as TotalWeekRealCost, --累计周完成成本
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanCost,0)) from WBS_CostControlParentDetail
|
||||
where ParentId=detail.ParentId and Months<=detail.Months)) as TotalPlanCost, --累计完成预算
|
||||
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanCost,0)) from WBS_CostControlParentDetail
|
||||
where ParentId=detail.ParentId and Months<=detail.Months and (StartDate<=detail.StartDate or StartDate is null))) as TotalWeekPlanCost --累计周完成预算
|
||||
FROM dbo.WBS_CostControlParentDetail AS detail
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
@@ -114,7 +114,11 @@ go
|
||||
-- GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('F3AA42B3-5776-4992-A625-1216C579FEDE','项目进度情况','JDGL/Check/ProgressCompletion.aspx',60,'0','Menu_JDGL',0,1,1)
|
||||
VALUES('92CBD072-20F8-45B1-9D17-6F7494DD2020','数据导入','',60,'0','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('F3AA42B3-5776-4992-A625-1216C579FEDE','项目进度情况','JDGL/Check/ProgressCompletion.aspx',60,'92CBD072-20F8-45B1-9D17-6F7494DD2020','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('8232DE3C-307C-49ED-9A37-6C29A94AABDF','F3AA42B3-5776-4992-A625-1216C579FEDE','增加',1)
|
||||
@@ -127,56 +131,56 @@ GO
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('2AE9D982-A499-497F-8F54-ADDA5856887E','工程量完成情况','JDGL/Check/QuantityCompletion.aspx',70,'0','Menu_JDGL',0,1,1)
|
||||
VALUES('2AE9D982-A499-497F-8F54-ADDA5856887E','工程量完成情况','JDGL/Check/QuantityCompletion.aspx',70,'92CBD072-20F8-45B1-9D17-6F7494DD2020','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('BDBABEE5-DE52-47BA-9799-ACB7EE76F3FA','2AE9D982-A499-497F-8F54-ADDA5856887E','保存',1)
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('82E513B9-1A6F-495A-A633-EBC89CE5273A','低温储罐完成情况','JDGL/Check/LowTankCompletion.aspx',80,'0','Menu_JDGL',0,1,1)
|
||||
VALUES('82E513B9-1A6F-495A-A633-EBC89CE5273A','低温储罐完成情况','JDGL/Check/LowTankCompletion.aspx',80,'92CBD072-20F8-45B1-9D17-6F7494DD2020','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('B09CE48A-C905-49A9-AFF1-AE15B5B71422','82E513B9-1A6F-495A-A633-EBC89CE5273A','保存',1)
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('4ACA0647-4D44-462E-8277-1EF9F100566A','钢结构完成情况','JDGL/Check/SteelStructureCompletion.aspx',90,'0','Menu_JDGL',0,1,1)
|
||||
VALUES('4ACA0647-4D44-462E-8277-1EF9F100566A','钢结构完成情况','JDGL/Check/SteelStructureCompletion.aspx',90,'92CBD072-20F8-45B1-9D17-6F7494DD2020','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('9EACCE68-163F-4E47-B1AF-179E813B3A12','4ACA0647-4D44-462E-8277-1EF9F100566A','保存',1)
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('92FD1845-F56C-4111-8BA0-91838A18B750','设备完成情况','JDGL/Check/EquipmentCompletion.aspx',100,'0','Menu_JDGL',0,1,1)
|
||||
VALUES('92FD1845-F56C-4111-8BA0-91838A18B750','设备完成情况','JDGL/Check/EquipmentCompletion.aspx',100,'92CBD072-20F8-45B1-9D17-6F7494DD2020','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('B69B59B4-E58D-40F6-8097-D6782FE3ED68','92FD1845-F56C-4111-8BA0-91838A18B750','保存',1)
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('9AE07A76-3A54-4414-BC8C-C86A18C737BA','管道完成情况','JDGL/Check/PipelineCompletion.aspx',110,'0','Menu_JDGL',0,1,1)
|
||||
VALUES('9AE07A76-3A54-4414-BC8C-C86A18C737BA','管道完成情况','JDGL/Check/PipelineCompletion.aspx',110,'92CBD072-20F8-45B1-9D17-6F7494DD2020','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('EB18C5C6-3303-410B-ACA9-A82B3239CDA4','9AE07A76-3A54-4414-BC8C-C86A18C737BA','保存',1)
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('8A8A1050-F227-42ED-9456-8CB5ECA36512','电气完成情况','JDGL/Check/ElectricalCompletion.aspx',120,'0','Menu_JDGL',0,1,1)
|
||||
VALUES('8A8A1050-F227-42ED-9456-8CB5ECA36512','电气完成情况','JDGL/Check/ElectricalCompletion.aspx',120,'92CBD072-20F8-45B1-9D17-6F7494DD2020','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('5EDC2141-3218-4C80-9A69-AD1FBD5BCEF5','8A8A1050-F227-42ED-9456-8CB5ECA36512','保存',1)
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('7EC1FBAF-BEC9-46CD-9E3B-0D0093B4E1C2','仪表完成情况','JDGL/Check/MeterCompletion.aspx',130,'0','Menu_JDGL',0,1,1)
|
||||
VALUES('7EC1FBAF-BEC9-46CD-9E3B-0D0093B4E1C2','仪表完成情况','JDGL/Check/MeterCompletion.aspx',130,'92CBD072-20F8-45B1-9D17-6F7494DD2020','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('10527FF2-975E-49DA-B4C7-3FE69FCBA7B3','7EC1FBAF-BEC9-46CD-9E3B-0D0093B4E1C2','保存',1)
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('C7037A5D-D8A6-4C1C-A5B8-2083C31C0A7B','全厂地下管网完成情况','JDGL/Check/UndergroundPipeCompletion.aspx',140,'0','Menu_JDGL',0,1,1)
|
||||
VALUES('C7037A5D-D8A6-4C1C-A5B8-2083C31C0A7B','全厂地下管网完成情况','JDGL/Check/UndergroundPipeCompletion.aspx',140,'92CBD072-20F8-45B1-9D17-6F7494DD2020','Menu_JDGL',0,1,1)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('BECB2F6E-90D5-432C-A56C-9F8AAF62C511','C7037A5D-D8A6-4C1C-A5B8-2083C31C0A7B','保存',1)
|
||||
|
||||
Reference in New Issue
Block a user