项目基础信息合同面积取值优化
This commit is contained in:
parent
e2da7436b7
commit
7d3844d049
@ -1,3 +1,8 @@
|
|||||||
|
-- *****************************
|
||||||
|
-- 修改人: 杨坤安
|
||||||
|
-- 修改日期: 2024-09-06
|
||||||
|
-- 修改内容: 一个项目接管面积会有多个,先累加再关联
|
||||||
|
-- *****************************
|
||||||
select
|
select
|
||||||
b.CommId
|
b.CommId
|
||||||
, case when b.CommKind = '0001' then '商住'
|
, case when b.CommKind = '0001' then '商住'
|
||||||
@ -90,8 +95,23 @@ from (
|
|||||||
, sum(TakeOverArea) TakeOverArea
|
, sum(TakeOverArea) TakeOverArea
|
||||||
, sum(ContractArea) ContractArea
|
, sum(ContractArea) ContractArea
|
||||||
, sum(ManageContractArea) ManageContractArea
|
, sum(ManageContractArea) ManageContractArea
|
||||||
from (select * from ods_erp_tb_hspr_projecttakeoverinformation_d where IsDelete = 0) a
|
from
|
||||||
left join (select TakeOverArea, ParentId from ods_erp_tb_hspr_projecttakeoverdetail_d WHERE IsDelete = 0) b
|
(
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from ods_erp_tb_hspr_projecttakeoverinformation_d
|
||||||
|
where IsDelete = 0
|
||||||
|
) a
|
||||||
|
left join
|
||||||
|
(
|
||||||
|
select
|
||||||
|
ParentId
|
||||||
|
,SUM(TakeOverArea) AS TakeOverArea
|
||||||
|
from ods_erp_tb_hspr_projecttakeoverdetail_d
|
||||||
|
WHERE IsDelete = 0
|
||||||
|
group by
|
||||||
|
ParentId
|
||||||
|
) b
|
||||||
on a.id = b.ParentId
|
on a.id = b.ParentId
|
||||||
right join (select * from ods_erp_tb_hspr_projectbasicinfomation_d where IsDelete = 0) c
|
right join (select * from ods_erp_tb_hspr_projectbasicinfomation_d where IsDelete = 0) c
|
||||||
on a.ParentId = c.id
|
on a.ParentId = c.id
|
||||||
|
Loading…
Reference in New Issue
Block a user