add workflow 荟聚API_2,dev

This commit is contained in:
root 2024-04-25 11:38:45 +08:00
parent 90fda14e6b
commit becb82e24a
6 changed files with 24 additions and 21 deletions

View File

@ -3,8 +3,8 @@
/*VERSION 01.10 revised on 2020-08-25 */ /*VERSION 01.10 revised on 2020-08-25 */
/*Brilliance stems from wisdoms. */ /*Brilliance stems from wisdoms. */
/*************Head Section**************************************************************************/ /*************Head Section**************************************************************************/
/*Script Use: Periodically load data to :t01_scrm_leads(SCRM线索-api) */ /*Script Use: Periodically load data to :t01_scrm_leads(SCRM线索) */
/*Create Date:2024-04-18 16:23:34 */ /*Create Date:2024-04-18 16:32:47 */
/*SDM Developed By: dev */ /*SDM Developed By: dev */
/*SDM Developed Date: 2024-04-18 */ /*SDM Developed Date: 2024-04-18 */
/*SDM Checked By: dev */ /*SDM Checked By: dev */
@ -589,10 +589,10 @@ from :SADB.s98_s_customer_event_meta) p1
,tag /*tag*/ ,tag /*tag*/
,c_keyword /*c_keyword*/ ,c_keyword /*c_keyword*/
,attr2 /*attr2*/ ,attr2 /*attr2*/
,label /*label*/
,group_label /*groupLabel*/ ,group_label /*groupLabel*/
,customer_id /*customerId*/ ,customer_id /*customerId*/
,date /*date*/ ,date /*date*/
,label /*label*/
,etl_batch_no /*作业批次号*/ ,etl_batch_no /*作业批次号*/
,etl_first_dt /*最初入库时间*/ ,etl_first_dt /*最初入库时间*/
,etl_job /*作业名称*/ ,etl_job /*作业名称*/
@ -611,10 +611,10 @@ from :SADB.s98_s_customer_event_meta) p1
,P1.tag /*tag*/ ,P1.tag /*tag*/
,P1.c_keyword /*c_keyword*/ ,P1.c_keyword /*c_keyword*/
,P1.attr2 /*attr2*/ ,P1.attr2 /*attr2*/
,P1.label /*label*/
,P1.group_label /*groupLabel*/ ,P1.group_label /*groupLabel*/
,P1.customer_id /*customerId*/ ,P1.customer_id /*customerId*/
,P1.date /*date*/ ,P1.date /*date*/
,P1.label /*label*/
,P1.etl_batch_no /*作业批次号*/ ,P1.etl_batch_no /*作业批次号*/
,P1.etl_first_dt /*最初入库时间*/ ,P1.etl_first_dt /*最初入库时间*/
,P1.etl_job /*作业名称*/ ,P1.etl_job /*作业名称*/
@ -633,10 +633,10 @@ ON P1.target_name = P2.target_name
AND P1.tag = P2.tag AND P1.tag = P2.tag
AND P1.c_keyword = P2.c_keyword AND P1.c_keyword = P2.c_keyword
AND P1.attr2 = P2.attr2 AND P1.attr2 = P2.attr2
AND P1.label = P2.label
AND P1.group_label = P2.group_label AND P1.group_label = P2.group_label
AND P1.customer_id = P2.customer_id AND P1.customer_id = P2.customer_id
AND P1.date = P2.date AND P1.date = P2.date
AND P1.label = P2.label
WHERE P2.target_name IS NULL WHERE P2.target_name IS NULL
OR P2.c_name IS NULL OR P2.c_name IS NULL
@ -646,10 +646,10 @@ WHERE P2.target_name IS NULL
OR P2.tag IS NULL OR P2.tag IS NULL
OR P2.c_keyword IS NULL OR P2.c_keyword IS NULL
OR P2.attr2 IS NULL OR P2.attr2 IS NULL
OR P2.label IS NULL
OR P2.group_label IS NULL OR P2.group_label IS NULL
OR P2.customer_id IS NULL OR P2.customer_id IS NULL
OR P2.date IS NULL OR P2.date IS NULL
OR P2.label IS NULL
; ;
/*将新增数据插入到目标表 */ /*将新增数据插入到目标表 */
@ -662,10 +662,10 @@ WHERE P2.target_name IS NULL
,tag /*tag*/ ,tag /*tag*/
,c_keyword /*c_keyword*/ ,c_keyword /*c_keyword*/
,attr2 /*attr2*/ ,attr2 /*attr2*/
,label /*label*/
,group_label /*groupLabel*/ ,group_label /*groupLabel*/
,customer_id /*customerId*/ ,customer_id /*customerId*/
,date /*date*/ ,date /*date*/
,label /*label*/
,etl_batch_no /*作业批次号*/ ,etl_batch_no /*作业批次号*/
,etl_first_dt /*最初入库时间*/ ,etl_first_dt /*最初入库时间*/
,etl_job /*作业名称*/ ,etl_job /*作业名称*/
@ -684,10 +684,10 @@ SELECT
,P1.tag /*tag*/ ,P1.tag /*tag*/
,P1.c_keyword /*c_keyword*/ ,P1.c_keyword /*c_keyword*/
,P1.attr2 /*attr2*/ ,P1.attr2 /*attr2*/
,P1.label /*label*/
,P1.group_label /*groupLabel*/ ,P1.group_label /*groupLabel*/
,P1.customer_id /*customerId*/ ,P1.customer_id /*customerId*/
,P1.date /*date*/ ,P1.date /*date*/
,P1.label /*label*/
,P1.etl_batch_no /*作业批次号*/ ,P1.etl_batch_no /*作业批次号*/
,P1.etl_first_dt /*最初入库时间*/ ,P1.etl_first_dt /*最初入库时间*/
,P1.etl_job /*作业名称*/ ,P1.etl_job /*作业名称*/
@ -697,10 +697,11 @@ SELECT
,P1.src_table /*来源表*/ ,P1.src_table /*来源表*/
FROM t01_scrm_leads_agi_INS P1 FROM t01_scrm_leads_agi_INS P1
ON CONFLICT ( customer_id,date) ON CONFLICT ( customer_id,date,label)
DO UPDATE SET DO UPDATE SET
customer_id=excluded.customer_id customer_id=excluded.customer_id
,date=excluded.date ,date=excluded.date
,label=excluded.label
,target_name=excluded.target_name ,target_name=excluded.target_name
,c_name=excluded.c_name ,c_name=excluded.c_name
,c_type=excluded.c_type ,c_type=excluded.c_type
@ -709,7 +710,6 @@ DO UPDATE SET
,tag=excluded.tag ,tag=excluded.tag
,c_keyword=excluded.c_keyword ,c_keyword=excluded.c_keyword
,attr2=excluded.attr2 ,attr2=excluded.attr2
,label=excluded.label
,group_label=excluded.group_label ,group_label=excluded.group_label
,etl_batch_no=excluded.etl_batch_no ,etl_batch_no=excluded.etl_batch_no
,etl_first_dt=excluded.etl_first_dt ,etl_first_dt=excluded.etl_first_dt

View File

@ -4,11 +4,11 @@
/*Brilliance stems from wisdoms. */ /*Brilliance stems from wisdoms. */
/*************Head Section**************************************************************************/ /*************Head Section**************************************************************************/
/*Script Use: Periodically load data to :t01_scrm_contact(SCRM联系方式-api) */ /*Script Use: Periodically load data to :t01_scrm_contact(SCRM联系方式-api) */
/*Create Date:2024-04-18 17:50:02 */ /*Create Date:2024-04-25 11:17:31 */
/*SDM Developed By: dev */ /*SDM Developed By: dev */
/*SDM Developed Date: 2024-04-18 */ /*SDM Developed Date: 2024-04-18 */
/*SDM Checked By: dev */ /*SDM Checked By: dev */
/*SDM Checked Date: 2024-04-18 */ /*SDM Checked Date: 2024-04-25 */
/*Script Developed By: dev */ /*Script Developed By: dev */
/*Script Checked By: dev */ /*Script Checked By: dev */
/*Source table 1: p10_sa.s98_s_scrm_contact */ /*Source table 1: p10_sa.s98_s_scrm_contact */
@ -42,6 +42,7 @@ ON COMMIT PRESERVE ROWS;
/*****************************************************************************************************/ /*****************************************************************************************************/
/* GROUP 1:Source Table:s98_s_scrm_contact************************************************************/ /* GROUP 1:Source Table:s98_s_scrm_contact************************************************************/
/*****************************************************************************************************/ /*****************************************************************************************************/
INSERT INTO t01_scrm_contact_agi_CUR_I ( INSERT INTO t01_scrm_contact_agi_CUR_I (
scrm_leads_id /*SCRM线索ID*/ scrm_leads_id /*SCRM线索ID*/
,city_name /*城市*/ ,city_name /*城市*/
@ -83,6 +84,8 @@ SELECT
FROM p10_sa.s98_s_scrm_contact p0 FROM p10_sa.s98_s_scrm_contact p0
LEFT JOIN (select distinct customer_id from :SADB.s98_s_customer_events_add_user) p1 LEFT JOIN (select distinct customer_id from :SADB.s98_s_customer_events_add_user) p1
ON p0.id=p1.customer_id ON p0.id=p1.customer_id
where p1.customer_id is not null or p0.mobile is not null or p0.email is not null
; ;

View File

@ -4,11 +4,11 @@
/*Brilliance stems from wisdoms. */ /*Brilliance stems from wisdoms. */
/*************Head Section**************************************************************************/ /*************Head Section**************************************************************************/
/*Script Use: Periodically load data to :t01_scrm_contact_update(SCRM联系方式变更-api) */ /*Script Use: Periodically load data to :t01_scrm_contact_update(SCRM联系方式变更-api) */
/*Create Date:2024-04-18 17:49:02 */ /*Create Date:2024-04-25 11:16:24 */
/*SDM Developed By: dev */ /*SDM Developed By: dev */
/*SDM Developed Date: 2024-04-18 */ /*SDM Developed Date: 2024-04-18 */
/*SDM Checked By: dev */ /*SDM Checked By: dev */
/*SDM Checked Date: 2024-04-18 */ /*SDM Checked Date: 2024-04-25 */
/*Script Developed By: dev */ /*Script Developed By: dev */
/*Script Checked By: dev */ /*Script Checked By: dev */
/*Source table 1: :SADB.s98_s_scrm_contact */ /*Source table 1: :SADB.s98_s_scrm_contact */
@ -87,7 +87,7 @@ LEFT JOIN (select distinct customer_id from :SADB.s98_s_customer_events_add_user
ON p0.id=p1.customer_id ON p0.id=p1.customer_id
LEFT JOIN :SADB.s98_s_scrm_contact p2 LEFT JOIN :SADB.s98_s_scrm_contact p2
ON p0.id=p2.id ON p0.id=p2.id
where p2.id is null and p1.customer_id is not null and p0.mobile is not null and p0.email is not null where p1.customer_id is not null or p0.mobile is not null or p0.email is not null
; ;

View File

@ -33,7 +33,7 @@ insert into p10_sa.S98_S_customer_events
from p00_tal.S98_S_customer_events from p00_tal.S98_S_customer_events
; ;
delete from p12_sfull.S98_S_customer_events delete from p12_sfull.S98_S_customer_events
; where (id) in (select id from p10_sa.S98_S_customer_events) ;
; ;
insert into p12_sfull.S98_S_customer_events insert into p12_sfull.S98_S_customer_events
( id ( id

View File

@ -63,7 +63,7 @@ insert into p10_sa.S98_S_customer_events_open_content_page
from p00_tal.S98_S_customer_events_open_content_page from p00_tal.S98_S_customer_events_open_content_page
; ;
delete from p12_sfull.S98_S_customer_events_open_content_page delete from p12_sfull.S98_S_customer_events_open_content_page
; where (id) in (select id from p10_sa.S98_S_customer_events_open_content_page) ;
; ;
insert into p12_sfull.S98_S_customer_events_open_content_page insert into p12_sfull.S98_S_customer_events_open_content_page
( id ( id

View File

@ -71,7 +71,7 @@ insert into p10_sa.S98_S_customer_events_open_page
from p00_tal.S98_S_customer_events_open_page from p00_tal.S98_S_customer_events_open_page
; ;
delete from p12_sfull.S98_S_customer_events_open_page delete from p12_sfull.S98_S_customer_events_open_page
; where (id) in (select id from p10_sa.S98_S_customer_events_open_page) ;
; ;
insert into p12_sfull.S98_S_customer_events_open_page insert into p12_sfull.S98_S_customer_events_open_page
( id ( id