From 405f9393edeabd34ca578e02e967b708dbdc2997 Mon Sep 17 00:00:00 2001 From: chenwu Date: Thu, 21 May 2026 07:04:00 +0000 Subject: [PATCH] =?UTF-8?q?pack=20info=E8=A1=A8=E4=B8=AD=E7=9A=84chc?= =?UTF-8?q?=E5=92=8Cthc=E7=9A=84=E8=A1=A8=E6=9B=BF=E6=8D=A2=E6=88=90dm?= =?UTF-8?q?=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 07 dm_td_external_packinfo.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/07 dm_td_external_packinfo.sql b/07 dm_td_external_packinfo.sql index 7afddf5..ff79a0b 100644 --- a/07 dm_td_external_packinfo.sql +++ b/07 dm_td_external_packinfo.sql @@ -298,11 +298,11 @@ select * from tmp.tmp_county_dm_td_external_packinfo insert overwrite table tmp.tmp_thc_dm_td_external_packinfo with temp as ( -- 临时表补充维度 SELECT - iqvia_pack_code PACK_COD, + PACK_COD PACK_COD, MAX(B.PACK_DES) PACK_DES, MAX(B.STGH_DES) STGH_DES, MAX(B.PACK_LCH) PACK_LCH, - MAX(B.iqvia_prod_code) PROD_COD, + MAX(B.prod_cod) PROD_COD, MAX(B.PROD_DES) PROD_DES, MAX(B.PROD_DES_C) PROD_DES_C, MAX(B.CMPS_COD) CMPS_COD, @@ -358,8 +358,8 @@ with temp as ( -- 临时表补充维度 WHEN MAX(B.GENE_ORIG_DESC) = 'TCM' THEN 4 ELSE 5 END GEN_RN -FROM dwd.dwd_gnd_ext_thc_pack_property B - GROUP BY B.iqvia_pack_code +FROM dm.dm_thc_pack_property B + GROUP BY B.pack_cod ) select A.PACK_COD @@ -435,11 +435,11 @@ with temp as ( -- dm.dm_td_external_packinfo_temp 该表数 --01首先是根据主表数据(带多个source)关联chpa的pack_porperty表,取出相关维度 --02chpa中,没有的code,他的维度字段会被置为空,所以要关联我们自己处理好的维度表,来补充相关维度 SELECT - iqvia_pack_code PACK_COD, + pack_cod PACK_COD, MAX(B.PACK_DES) PACK_DES, MAX(B.STGH_DES) STGH_DES, MAX(B.PACK_LCH) PACK_LCH, - MAX(B.iqvia_prod_code) PROD_COD, + MAX(B.prod_cod) PROD_COD, MAX(B.PROD_DES) PROD_DES, MAX(B.PROD_DES_C) PROD_DES_C, MAX(B.CMPS_COD) CMPS_COD, @@ -495,8 +495,8 @@ with temp as ( -- dm.dm_td_external_packinfo_temp 该表数 WHEN MAX(B.GENE_ORIG_DESC) = 'TCM' THEN 4 ELSE 5 END GEN_RN -FROM dwd.dwd_gnd_ext_chc_pack_property B -GROUP BY B.iqvia_pack_code +FROM dm.dm_chc_pack_property B +GROUP BY B.pack_cod ) select A.PACK_COD