add workflow 市场News-Agents调度,dev
This commit is contained in:
parent
9d0b547898
commit
d0314afacf
|
|
@ -80,6 +80,13 @@ left join p70_ai_intelligence.agent_recommendation_cache p5
|
||||||
on p1.company_name=p5.company_name
|
on p1.company_name=p5.company_name
|
||||||
order by p1.company_name,p1.source_url,p1.create_tm desc,p5.created_at desc;
|
order by p1.company_name,p1.source_url,p1.create_tm desc,p5.created_at desc;
|
||||||
|
|
||||||
|
update p60_mart.news_letter_info p1
|
||||||
|
set saler_name=p2.saler_name
|
||||||
|
from p30_common.account_tsm_rela_t p2
|
||||||
|
where p1.account_name ~ p2.account_name
|
||||||
|
and p2.data_type='news_letter';
|
||||||
|
|
||||||
|
|
||||||
drop table if exists enterprise_card_funnel_one_t2;
|
drop table if exists enterprise_card_funnel_one_t2;
|
||||||
create temporary table enterprise_card_funnel_one_t2
|
create temporary table enterprise_card_funnel_one_t2
|
||||||
as
|
as
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@ create temporary table recruitment_t1
|
||||||
as
|
as
|
||||||
select distinct on (p1.company_name,p1.recruitment_title) p1.company_name,p2.saler_name,p1.whitelist_flag,p1.recruitment_title
|
select distinct on (p1.company_name,p1.recruitment_title) p1.company_name,p2.saler_name,p1.whitelist_flag,p1.recruitment_title
|
||||||
,p1.summary ,p1.tek_products ,p1.tk_relevance,p1.industry ,p1.prov_name ,p1.city_name ,p1.district,p1.source_url,p1.business_type,p1.create_tm
|
,p1.summary ,p1.tek_products ,p1.tk_relevance,p1.industry ,p1.prov_name ,p1.city_name ,p1.district,p1.source_url,p1.business_type,p1.create_tm
|
||||||
from (select p1.company company_name
|
from (select p1.company_name company_name
|
||||||
,case when p3.account_name is not null then '1' else '0' end whitelist_flag,p1.content_title recruitment_title
|
,case when p3.account_name is not null then '1' else '0' end whitelist_flag,p1.title recruitment_title
|
||||||
,p1.summary ,p1.recommended_products tek_products,p1.relevance_analysis tk_relevance,p2.industry ,p2.prov_name ,p2.city_name ,coalesce(p3.district)district ,p1.url source_url,'招聘信息' business_type,p1.created_at create_tm
|
,p1.insight summary ,'' tek_products,'' tk_relevance,p2.industry ,p2.prov_name ,p2.city_name ,coalesce(p3.district)district ,'' source_url,'招聘信息' business_type,p1.create_tm create_tm
|
||||||
from p70_ai_intelligence.agent_recruitment_summary p1
|
from p30_common.a_recruitment_intelligence p1
|
||||||
left join p30_common.d_account_info p2
|
left join p30_common.d_account_info p2
|
||||||
on p1.company =p2."name"
|
on p1.company_name =p2."name"
|
||||||
left join p30_common.white_list p3
|
left join p30_common.white_list p3
|
||||||
on (p1.company =p3.account_name)
|
on (p1.company_name =p3.account_name)
|
||||||
and p3.as_of_date='2025-12-19'
|
and p3.as_of_date='2025-12-19'
|
||||||
where p2."name" is not null)p1
|
where p2."name" is not null)p1
|
||||||
left join p20_pdm.t00_china_city_pnum p2
|
left join p20_pdm.t00_china_city_pnum p2
|
||||||
|
|
@ -65,11 +65,12 @@ order by p1.tek_opportunity_id,status_last_update desc,p1.as_of_date asc;
|
||||||
delete from p60_mart.news_letter_info
|
delete from p60_mart.news_letter_info
|
||||||
where source_system='recruitment_summary';
|
where source_system='recruitment_summary';
|
||||||
INSERT INTO p60_mart.news_letter_info
|
INSERT INTO p60_mart.news_letter_info
|
||||||
(account_name, saler_name, whitelist_flag, newsletter_title, summary, key_products, tek_relevance, industry, prov_name, city_name, district, contact_qty, total_funnel, report_amt,source_url,business_type,create_tm,source_system)
|
(account_name, saler_name, whitelist_flag, newsletter_title, summary, key_products, tek_relevance, industry, prov_name, city_name, district, contact_qty, total_funnel, report_amt,source_url,business_type,create_tm,source_system,portal_url,zip_url)
|
||||||
select distinct on (p1.company_name,p1.source_url) p1.company_name account_name, coalesce(saler_name,''), whitelist_flag, recruitment_title, summary
|
select distinct on (p1.company_name,p1.source_url) p1.company_name account_name, coalesce(saler_name,''), whitelist_flag, recruitment_title, summary
|
||||||
, case when p5.data_json::text like '{%' then replace(replace(replace(p5.data_json->>'主营产品'::text,'"',''),'[',''),']','')
|
, case when p5.data_json::text like '{%' then replace(replace(replace(p5.data_json->>'主营产品'::text,'"',''),'[',''),']','')
|
||||||
when p5.data_json::text like '[%' then replace(replace(replace(p5.data_json::text,'"',''),'[',''),']','') else '' end
|
when p5.data_json::text like '[%' then replace(replace(replace(p5.data_json::text,'"',''),'[',''),']','') else '' end
|
||||||
,coalesce(p5.recomend_product_series::text,'') tek_relevance, industry, coalesce(prov_name,''), coalesce(city_name), district,coalesce(p2.contact_qty,0) contact_qty, coalesce(total_amt,0)+coalesce(total_amount,0) total_funnel,coalesce(total_amt,0) report_amt,p1.source_url,p1.business_type,p1.create_tm,'recruitment_summary' source_system from recruitment_t1 p1
|
,coalesce(p5.recomend_product_series::text,'') tek_relevance, industry, coalesce(prov_name,''), coalesce(city_name), district,coalesce(p2.contact_qty,0) contact_qty, coalesce(total_amt,0)+coalesce(total_amount,0) total_funnel,coalesce(total_amt,0) report_amt,p1.source_url,p1.business_type,p1.create_tm,'recruitment_summary' source_system
|
||||||
|
,p6.门户资源包,p6.压缩包链接 from recruitment_t1 p1
|
||||||
left join (select company,count(*) contact_qty from recruitment_contact_t1 group by 1 ) p2
|
left join (select company,count(*) contact_qty from recruitment_contact_t1 group by 1 ) p2
|
||||||
on p1.company_name=p2.company
|
on p1.company_name=p2.company
|
||||||
left join (select customer_name,sum(total_amt) total_amt from recruitment_funnel_one_t1 group by 1) p3
|
left join (select customer_name,sum(total_amt) total_amt from recruitment_funnel_one_t1 group by 1) p3
|
||||||
|
|
@ -78,8 +79,17 @@ left join (select account_name,sum(total_amount) total_amount from recruitment_f
|
||||||
on p1.company_name=p4.account_name
|
on p1.company_name=p4.account_name
|
||||||
left join p70_ai_intelligence.agent_recommendation_cache p5
|
left join p70_ai_intelligence.agent_recommendation_cache p5
|
||||||
on p1.company_name=p5.company_name
|
on p1.company_name=p5.company_name
|
||||||
|
left join p70_ai_intelligence.key_recommendation p6
|
||||||
|
on replace(replace(replace(p5.matched_keys::text,'"',''),',',','),' ','') like '%'||p6.关键词 ||'%'
|
||||||
order by p1.company_name,p1.source_url,p1.create_tm desc,p5.created_at desc;
|
order by p1.company_name,p1.source_url,p1.create_tm desc,p5.created_at desc;
|
||||||
|
|
||||||
|
update p60_mart.news_letter_info p1
|
||||||
|
set saler_name=p2.saler_name
|
||||||
|
from p30_common.account_tsm_rela_t p2
|
||||||
|
where p1.account_name ~ p2.account_name
|
||||||
|
and p2.data_type='news_letter';
|
||||||
|
|
||||||
|
|
||||||
drop table if exists recruitment_funnel_one_t2;
|
drop table if exists recruitment_funnel_one_t2;
|
||||||
create temporary table recruitment_funnel_one_t2
|
create temporary table recruitment_funnel_one_t2
|
||||||
as
|
as
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue