add workflow 天润dynamic邮件同步,dev

This commit is contained in:
root 2025-03-17 14:26:02 +08:00
parent 9c65e9de4c
commit 8b92acf67b
1 changed files with 3 additions and 3 deletions

View File

@ -121,7 +121,7 @@ SELECT
WHERE jsonb_extract_path_text(j, 'name') = '职位'),'') /*JOB_TITLE*/
,coalesce(p3.city_name,(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') = '317832'),(SELECT jsonb_extract_path_text(j, 'value')
WHERE jsonb_extract_path_text(j, 'id') = '317779'),(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'),'') /*CITY*/
,coalesce(p3.prov_name,p2.prov_name,'') /*STATE_COUNTY_LOCATION*/
@ -230,11 +230,11 @@ LEFT JOIN :PDMDB.t00_china_city_info p2
LEFT JOIN :PDMDB.t00_china_city_pnum p3
ON p3.full_name = case when length(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') = '317832'),(SELECT jsonb_extract_path_text(j, 'value')
WHERE jsonb_extract_path_text(j, 'id') = '317779'),(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)>0 then 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') = '317832'),(SELECT jsonb_extract_path_text(j, 'value')
WHERE jsonb_extract_path_text(j, 'id') = '317779'),(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 else '' end
where p0.state_selected in ('Leads') and p0.update_time >= current_date - interval '7 days'