From b41926216dafd70630d0b75e97ef86958389b89c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Aug 2024 17:04:23 +0800 Subject: [PATCH] =?UTF-8?q?add=20workflow=20=E5=A4=A9=E6=B6=A6Smart-ccc?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=95=B0=E6=8D=AE,dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../f_ccc_work_ticket_integ_agi.sql | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/dev/workflow/TK_Cust/smart_ccc_ticket/smartccc工单信息集成/f_ccc_work_ticket_integ_agi.sql b/dev/workflow/TK_Cust/smart_ccc_ticket/smartccc工单信息集成/f_ccc_work_ticket_integ_agi.sql index ffb603f..1800630 100644 --- a/dev/workflow/TK_Cust/smart_ccc_ticket/smartccc工单信息集成/f_ccc_work_ticket_integ_agi.sql +++ b/dev/workflow/TK_Cust/smart_ccc_ticket/smartccc工单信息集成/f_ccc_work_ticket_integ_agi.sql @@ -4,7 +4,7 @@ /*Brilliance stems from wisdoms. */ /*************Head Section**************************************************************************/ /*Script Use: Periodically load data to :f_ccc_work_ticket_integ(smartccc工单信息集成) */ -/*Create Date:2024-08-01 10:28:41 */ +/*Create Date:2024-08-01 17:01:22 */ /*SDM Developed By: dev */ /*SDM Developed Date: 2024-07-09 */ /*SDM Checked By: dev */ @@ -43,6 +43,7 @@ ON COMMIT PRESERVE ROWS; /*****************************************************************************************************/ /* GROUP 1:Source Table:t01_ccc_work_ticket_info******************************************************/ /*****************************************************************************************************/ + INSERT INTO f_ccc_work_ticket_integ_agi_CUR_I ( PEXTENSION_CODE /*来源代码*/ ,PEXTENSION /*来源*/ @@ -102,9 +103,7 @@ SELECT when p1."source" ='呼叫中心' then '305972X317938' else '401890X401890' end,'') /*PEXTENSION_CODE*/ ,coalesce(p1."source",'') /*PEXTENSION*/ - ,coalesce((SELECT jsonb_extract_path_text(j, 'value') - FROM jsonb_array_elements(p1.customize::jsonb) j - WHERE jsonb_extract_path_text(j, 'name') = '姓名'),'') /*LAST_NAME*/ + ,COALESCE(TRIM(CAST(p0.customer_name AS varchar(20))),'') /*LAST_NAME*/ ,coalesce(p0.id,'') /*SUFFIX*/ ,coalesce((SELECT jsonb_extract_path_text(j, 'value') FROM jsonb_array_elements(p1.customize::jsonb) j @@ -113,8 +112,8 @@ SELECT FROM jsonb_array_elements(p1.customize::jsonb) j WHERE jsonb_extract_path_text(j, 'name') = '职位'),'') /*JOB_TITLE*/ ,coalesce((SELECT jsonb_extract_path_text(j, 'value') - FROM jsonb_array_elements(p1.customize::jsonb) j - WHERE jsonb_extract_path_text(j, 'name') = '城市'),'') /*CITY*/ + FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j + WHERE jsonb_extract_path_text(j, 'id') = '297755'),'') /*CITY*/ ,coalesce(p2.prov_name,'') /*STATE_COUNTY_LOCATION*/ ,'CN' /*COUNTRY_CODE*/ ,coalesce(p2.postalcode,'') /*POSTAL_CODE*/ @@ -184,9 +183,11 @@ FROM :PDMDB.t01_ccc_work_ticket_info p0 LEFT JOIN :PDMDB.t01_ccc_cust_info p1 ON p0.customer_id =p1.id LEFT JOIN :PDMDB.t00_china_city_info p2 - ON (SELECT jsonb_extract_path_text(j, 'value') - FROM jsonb_array_elements(p1.customize::jsonb) j - WHERE jsonb_extract_path_text(j, 'name') = '城市') = p2.city_name + ON p2.city_name like coalesce((SELECT jsonb_extract_path_text(j, 'value') + FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j + WHERE jsonb_extract_path_text(j, 'id') = '297755'),'')::text||'%' +where p0 .state_selected ='Leads' + ;