add workflow 天润Smart-ccc工单数据,dev

This commit is contained in:
root 2024-08-01 10:28:59 +08:00
parent 15b3b5f799
commit eef2f8ca15
1 changed files with 28 additions and 28 deletions

View File

@ -4,11 +4,11 @@
/*Brilliance stems from wisdoms. */
/*************Head Section**************************************************************************/
/*Script Use: Periodically load data to :f_ccc_work_ticket_integ(smartccc工单信息集成) */
/*Create Date:2024-07-09 15:13:26 */
/*Create Date:2024-08-01 10:28:41 */
/*SDM Developed By: dev */
/*SDM Developed Date: 2024-07-09 */
/*SDM Checked By: dev */
/*SDM Checked Date: 2024-07-09 */
/*SDM Checked Date: 2024-08-01 */
/*Script Developed By: dev */
/*Script Checked By: dev */
/*Source table 1: :PDMDB.t01_ccc_cust_info */
@ -97,58 +97,58 @@ INSERT INTO f_ccc_work_ticket_integ_agi_CUR_I (
,Etl_Batch_No /*作业批次号*/
)
SELECT
case when p1."source" ='在线咨询' then '401890X401890'
coalesce(case when p1."source" ='在线咨询' then '401890X401890'
when p1."source" ='接口创建' then '445769X445769'
when p1."source" ='呼叫中心' then '305972X317938'
else '401890X401890' end /*PEXTENSION_CODE*/
,p1."source" /*PEXTENSION*/
,(SELECT jsonb_extract_path_text(j, 'value')
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*/
,p0.id /*SUFFIX*/
,(SELECT jsonb_extract_path_text(j, 'value')
WHERE jsonb_extract_path_text(j, 'name') = '姓名'),'') /*LAST_NAME*/
,coalesce(p0.id,'') /*SUFFIX*/
,coalesce((SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements(p1.customize::jsonb) j
WHERE jsonb_extract_path_text(j, 'name') = '公司名称') /*COMPANY_NAME*/
,(SELECT jsonb_extract_path_text(j, 'value')
WHERE jsonb_extract_path_text(j, 'name') = '公司名称'),'') /*COMPANY_NAME*/
,coalesce((SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements(p1.customize::jsonb) j
WHERE jsonb_extract_path_text(j, 'name') = '职位') /*JOB_TITLE*/
,(SELECT jsonb_extract_path_text(j, 'value')
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*/
,p2.prov_name /*STATE_COUNTY_LOCATION*/
WHERE jsonb_extract_path_text(j, 'name') = '城市'),'') /*CITY*/
,coalesce(p2.prov_name,'') /*STATE_COUNTY_LOCATION*/
,'CN' /*COUNTRY_CODE*/
,p2.postalcode /*POSTAL_CODE*/
,replace(replace(replace(split_part(p1.tel,',',1),'"',''),'[',''),']','') /*CONTACT_MOBILE_NUMBER*/
,p1.email /*EMAIL_ADDRESS*/
,coalesce(p2.postalcode,'') /*POSTAL_CODE*/
,coalesce(replace(replace(replace(split_part(p1.tel,',',1),'"',''),'[',''),']',''),'') /*CONTACT_MOBILE_NUMBER*/
,coalesce(p1.email,'') /*EMAIL_ADDRESS*/
,'YES' /*REQUEST_A_DEMO*/
,'YES' /*REQUEST_A_QUOTE*/
,'YES' /*HAMCAM*/
,4 /*PURCHASE_INTENT*/
,'L - mql '||(SELECT jsonb_extract_path_text(field, 'value') AS value_298245
,coalesce('L - mql '||(SELECT jsonb_extract_path_text(field, 'value') AS value_298245
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
WHERE jsonb_extract_path_text(field, 'id')::int = 298246) /*COMMENTS*/
,(SELECT jsonb_extract_path_text(field, 'value') AS value_297729
WHERE jsonb_extract_path_text(field, 'id')::int = 298246),'') /*COMMENTS*/
,coalesce((SELECT jsonb_extract_path_text(field, 'value') AS value_297729
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
WHERE jsonb_extract_path_text(field, 'id')::int = 297729) /*INDUSTRY*/
,(SELECT jsonb_extract_path_text(field, 'value') AS value_298247
WHERE jsonb_extract_path_text(field, 'id')::int = 297729),'') /*INDUSTRY*/
,coalesce((SELECT jsonb_extract_path_text(field, 'value') AS value_298247
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
WHERE jsonb_extract_path_text(field, 'id')::int = 298247) /*CCP_PRODUCT_INTEREST_01*/
,(SELECT jsonb_extract_path_text(field, 'value') AS value_297730
WHERE jsonb_extract_path_text(field, 'id')::int = 298247),'') /*CCP_PRODUCT_INTEREST_01*/
,coalesce((SELECT jsonb_extract_path_text(field, 'value') AS value_297730
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
WHERE jsonb_extract_path_text(field, 'id')::int = 297730) /*CCP_APP_01_5*/
,(SELECT jsonb_extract_path_text(field, 'value') AS value_298300
WHERE jsonb_extract_path_text(field, 'id')::int = 297730),'') /*CCP_APP_01_5*/
,coalesce((SELECT jsonb_extract_path_text(field, 'value') AS value_298300
FROM (
SELECT jsonb_array_elements(p0.start_form::jsonb->'fields') AS field
) AS t
WHERE jsonb_extract_path_text(field, 'id')::int = 298300) /*LEAD_PRODUCTS_01_5*/
WHERE jsonb_extract_path_text(field, 'id')::int = 298300),'') /*LEAD_PRODUCTS_01_5*/
,'YES' /*PERMISSION_PHONE*/
,p0.create_time /*PERMISSION_PHONE_DATE*/
,'YES' /*PERMISSION_EMAIL*/