add workflow 天润dynamic邮件同步,dev

This commit is contained in:
root 2025-03-17 14:58:53 +08:00
parent 0f0e0ebdd5
commit 2a467730d8
1 changed files with 4 additions and 4 deletions

View File

@ -121,7 +121,7 @@ SELECT
WHERE jsonb_extract_path_text(j, 'name') = '职位'),'') /*JOB_TITLE*/ WHERE jsonb_extract_path_text(j, 'name') = '职位'),'') /*JOB_TITLE*/
,coalesce(p3.city_name,(SELECT jsonb_extract_path_text(j, 'value') ,coalesce(p3.city_name,(SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j
WHERE jsonb_extract_path_text(j, 'id') = '304585'),(SELECT jsonb_extract_path_text(j, 'value') WHERE jsonb_extract_path_text(j, 'id') = '317832'),(SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j
WHERE jsonb_extract_path_text(j, 'id') = '297755'),'') /*CITY*/ WHERE jsonb_extract_path_text(j, 'id') = '297755'),'') /*CITY*/
,coalesce(p3.prov_name,p2.prov_name,'') /*STATE_COUNTY_LOCATION*/ ,coalesce(p3.prov_name,p2.prov_name,'') /*STATE_COUNTY_LOCATION*/
@ -230,14 +230,14 @@ LEFT JOIN :PDMDB.t00_china_city_info p2
LEFT JOIN :PDMDB.t00_china_city_pnum p3 LEFT JOIN :PDMDB.t00_china_city_pnum p3
ON p3.full_name = case when length(coalesce((SELECT jsonb_extract_path_text(j, 'value') 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 FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j
WHERE jsonb_extract_path_text(j, 'id') = '304585'),(SELECT jsonb_extract_path_text(j, 'value') WHERE jsonb_extract_path_text(j, 'id') = '317832'),(SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j 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') 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 FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j
WHERE jsonb_extract_path_text(j, 'id') = '304585'),(SELECT jsonb_extract_path_text(j, 'value') WHERE jsonb_extract_path_text(j, 'id') = '317832'),(SELECT jsonb_extract_path_text(j, 'value')
FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j FROM jsonb_array_elements((p0.start_form::json -> 'fields')::jsonb) j
WHERE jsonb_extract_path_text(j, 'id') = '297755'),'')::text else '' end WHERE jsonb_extract_path_text(j, 'id') = '297755'),'')::text else '' end
where p0.state_selected in ('Leads') and p0.update_time >= current_date - interval '8 days' where p0.state_selected in ('Leads') and p0.update_time >= current_date - interval '3 days'
; ;