From 94894d2673b2273755a16fe11fa0705c79fa444c Mon Sep 17 00:00:00 2001 From: yangkunan Date: Tue, 24 Sep 2024 18:01:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=9A=E6=80=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8F=96=E5=80=BC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dw/dim/dim_project_base_info_d.sql | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dw/dim/dim_project_base_info_d.sql b/dw/dim/dim_project_base_info_d.sql index 8bfb4a2..1395e99 100644 --- a/dw/dim/dim_project_base_info_d.sql +++ b/dw/dim/dim_project_base_info_d.sql @@ -2,6 +2,8 @@ -- 修改人: 杨坤安 -- 修改日期: 2024-09-06 -- 修改内容: 一个项目接管面积会有多个,先累加再关联 +-- 修改日期: 2024-09-24 +-- 修改内容: 项目对应业态取值规则变更 -- ***************************** select b.CommId @@ -57,6 +59,7 @@ select , a.CityLevel , a.CommitteeTermStartDate , a.CommitteeTermEndDate + , b.DictionaryName AS StateNameNew from ( select c.CommId @@ -117,5 +120,26 @@ from ( on a.ParentId = c.id group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33 ) a - right join (select * from ods_erp_tb_hspr_community_d where IsDelete = 0) b - on a.CommId = b.CommId \ No newline at end of file + right join + ( + SELECT + b1.* + ,b2.DictionaryName + FROM + ( + select + * + from ods_erp_tb_hspr_community_d + where IsDelete = 0 + )b1 + LEFT JOIN + (-- add 2024-09-24 项目业态新规则取数 + select + DictionaryCode -- 项目业态编码 + ,DictionaryName -- 项目业态名称 + from ods_erp_tb_dictionary_projectformat_d + )b2 + ON B1.CommKind = b2.DictionaryCode + + ) b + on a.CommId = b.CommId \ No newline at end of file