add workflow 天润Smart-ccc通话记录,dev

This commit is contained in:
root 2024-09-02 13:20:52 +08:00
parent 8cb03defb3
commit 9460d14456
3 changed files with 577 additions and 1 deletions

View File

@ -0,0 +1,82 @@
DROP TABLE IF EXISTS p30_common.cust_call_ccc_record;
CREATE TABLE IF NOT EXISTS p30_common.cust_call_ccc_record (
unique_id VARCHAR(50)
, call_id VARCHAR(50)
, customer_number VARCHAR(20)
, customer_province VARCHAR(20)
, customer_city VARCHAR(20)
, call_number VARCHAR(20)
, call_cno VARCHAR(20)
, call_cname VARCHAR(20)
, call_qname VARCHAR(20)
, call_source_type varchar(20)
, call_type VARCHAR(10)
, call_type_desc VARCHAR(50)
, sip_cause_desc VARCHAR(50)
, call_status VARCHAR(20)
, call_result VARCHAR(20)
, webrtc_call_id VARCHAR(50)
, hotline_name VARCHAR(20)
, on_hook_source VARCHAR(20)
, investigation_keys VARCHAR(20)
, agent_answer_in_time VARCHAR(20)
, evaluation VARCHAR(20)
, start_time timestamp(0)
, ring_time timestamp(0)
, ib_ringing_duration int4
, end_time timestamp(0)
, answer_time timestamp(0)
, offhook_time timestamp(0)
, bridge_time timestamp(0)
, bridge_duration int4
, total_duration int4
, Etl_Batch_No varchar(50)
, Etl_First_Dt timestamp(0)
, Etl_Job varchar(200)
, Etl_Proc_Dt timestamp(0)
, Etl_Tx_Dt timestamp(0)
, Src_Sysname varchar(50)
, Src_Table varchar(50)
,primary key( unique_id,call_id )
);
COMMENT ON COLUMN p30_common.cust_call_ccc_record.unique_id IS '呼入通话ID';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_id IS 'CallID';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.customer_number IS '客户号码';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.customer_province IS '客户省份';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.customer_city IS '客户城市';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_number IS '座席电话';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_cno IS '座席工号';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_cname IS '座席姓名';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_qname IS '队列名称';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_source_type IS '呼叫来源类型';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_type IS '呼叫类型';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_type_desc IS '呼叫类型描述';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.sip_cause_desc IS '呼叫情况';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_status IS '接听状态';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.call_result IS '呼叫结果';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.webrtc_call_id IS 'WebRTCCallID';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.hotline_name IS '热线别名';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.on_hook_source IS '挂断方';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.investigation_keys IS '满意度评价';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.agent_answer_in_time IS '首次及时应答';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.evaluation IS '是否邀评';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.start_time IS '开始时间';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.ring_time IS '振铃时间';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.ib_ringing_duration IS '振铃时长';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.end_time IS '结束时间';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.answer_time IS '接听时间';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.offhook_time IS '座席接起时间';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.bridge_time IS '首次接听时间';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.bridge_duration IS '通话时长';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.total_duration IS '总时长';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.Etl_Batch_No IS '作业批次号';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.Etl_First_Dt IS '最初入库时间';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.Etl_Job IS '作业名称';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.Etl_Proc_Dt IS '本次入库时间';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.Etl_Tx_Dt IS '作业运行时间';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.Src_Sysname IS '来源系统';
COMMENT ON COLUMN p30_common.cust_call_ccc_record.Src_Table IS '来源表';
COMMENT ON TABLE p30_common.cust_call_ccc_record IS 'ccc通话记录';

View File

@ -0,0 +1,484 @@
/***************************************************************************************************/
/*script in Sql, generate by SdmCreateScript 2020(by Qihang Feng, QF255001@TERADATA.COM) */
/*VERSION 01.10 revised on 2020-08-25 */
/*Brilliance stems from wisdoms. */
/*************Head Section**************************************************************************/
/*Script Use: Periodically load data to :cust_call_ccc_record(ccc通话记录) */
/*Create Date:2024-08-30 10:00:22 */
/*SDM Developed By: dev */
/*SDM Developed Date: 2024-08-22 */
/*SDM Checked By: dev */
/*SDM Checked Date: 2024-08-30 */
/*Script Developed By: dev */
/*Script Checked By: dev */
/*Source table 1: :PDMDB.t01_ccc_ob_record */
/*Source table 2: :PDMDB.t01_ccc_ib_record */
/*Job Type: Inbound transform (Tier 1 to Tier 2) */
/*Target Table:cust_call_ccc_record */
/*ETL Job Name:cust_call_ccc_record */
/*ETL Frequency:Daily */
/*ETL Policy:F2 */
/********************************************************************************************/
/*******Main Section**************************************************************************/
\set ON_ERROR_STOP on
\set AUTOCOMMIT on
\timing on
/*创建临时表加载当前数据 */
CREATE TEMPORARY TABLE cust_call_ccc_record_agi_CUR_I
( LIKE :COMMDB.cust_call_ccc_record)
ON COMMIT PRESERVE ROWS;
/*创建临时表加载不同数据 */
CREATE TEMPORARY TABLE cust_call_ccc_record_agi_INS
( LIKE :COMMDB.cust_call_ccc_record)
ON COMMIT PRESERVE ROWS;
/*****************************************************************************************************/
/* GROUP 1:Source Table:t01_ccc_ib_record*************************************************************/
/*****************************************************************************************************/
INSERT INTO cust_call_ccc_record_agi_CUR_I (
unique_id /*呼入通话ID*/
,call_id /*CallID*/
,customer_number /*客户号码*/
,customer_province /*客户省份*/
,customer_city /*客户城市*/
,call_number /*座席电话*/
,call_cno /*座席工号*/
,call_cname /*座席姓名*/
,call_qname /*队列名称*/
,call_source_type /*呼叫来源类型*/
,call_type /*呼叫类型*/
,call_type_desc /*呼叫类型描述*/
,sip_cause_desc /*呼叫情况*/
,call_status /*接听状态*/
,call_result /*呼叫结果*/
,webrtc_call_id /*WebRTCCallID*/
,hotline_name /*热线别名*/
,on_hook_source /*挂断方*/
,investigation_keys /*满意度评价*/
,agent_answer_in_time /*首次及时应答*/
,evaluation /*是否邀评*/
,start_time /*开始时间*/
,ring_time /*振铃时间*/
,ib_ringing_duration /*振铃时长*/
,end_time /*结束时间*/
,answer_time /*接听时间*/
,offhook_time /*座席接起时间*/
,bridge_time /*首次接听时间*/
,bridge_duration /*通话时长*/
,total_duration /*总时长*/
,Etl_Batch_No /*作业批次号*/
,Etl_First_Dt /*最初入库时间*/
,Etl_Job /*作业名称*/
,Etl_Proc_Dt /*本次入库时间*/
,Etl_Tx_Dt /*作业运行时间*/
,Src_Sysname /*来源系统*/
,Src_Table /*来源表*/
)
SELECT
COALESCE(TRIM(p0.ib_unique_id),'') /*unique_id*/
,COALESCE(TRIM(p0.call_id),'') /*call_id*/
,COALESCE(TRIM(p0.customer_number),'') /*customer_number*/
,COALESCE(TRIM(p0.customer_province),'') /*customer_province*/
,COALESCE(TRIM(p0.customer_city),'') /*customer_city*/
,COALESCE(TRIM(p0.first_call_number),'') /*call_number*/
,COALESCE(TRIM(p0.first_call_cno),'') /*call_cno*/
,COALESCE(TRIM(p0.first_call_cname),'') /*call_cname*/
,COALESCE(TRIM(p0.first_call_qname),'') /*call_qname*/
,'InBound' /*call_source_type*/
,COALESCE(TRIM(p0.call_type),'') /*call_type*/
,'' /*call_type_desc*/
,COALESCE(TRIM(p0.sip_cause_desc),'') /*sip_cause_desc*/
,COALESCE(TRIM(p0.ib_status),'') /*call_status*/
,COALESCE(TRIM(p0.ib_result),'') /*call_result*/
,COALESCE(TRIM(p0.webrtc_call_id),'') /*webrtc_call_id*/
,COALESCE(TRIM(p0.hotline_name),'') /*hotline_name*/
,COALESCE(TRIM(p0.on_hook_source),'') /*on_hook_source*/
,COALESCE(TRIM(p0.investigation_keys),'') /*investigation_keys*/
,COALESCE(TRIM(p0.agent_answer_in_time),'') /*agent_answer_in_time*/
,COALESCE(TRIM(p0.evaluation),'') /*evaluation*/
,COALESCE(p0.start_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*start_time*/
,COALESCE(p0.ring_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*ring_time*/
,COALESCE(p0.ib_ringing_duration,0) /*ib_ringing_duration*/
,COALESCE(p0.end_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*end_time*/
,COALESCE(p0.answer_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*answer_time*/
,COALESCE(p0.offhook_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*offhook_time*/
,COALESCE(p0.bridge_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*bridge_time*/
,COALESCE(p0.bridge_duration,0) /*bridge_duration*/
,COALESCE(p0.total_duration,0) /*total_duration*/
,0 /*Etl_Batch_No*/
,TO_DATE(:TXDATE,'YYYYMMDD') /*Etl_First_Dt*/
,:ETLJOB /*Etl_Job*/
,current_timestamp(0) /*Etl_Proc_Dt*/
,TO_DATE(:TXDATE,'YYYYMMDD') /*Etl_Tx_Dt*/
,Substr('t01_ccc_ib_record',1,3) /*Src_Sysname*/
,'t01_ccc_ib_record' /*Src_Table*/
FROM :PDMDB.t01_ccc_ib_record p0
;
/*****************************************************************************************************/
/* GROUP 2:Source Table:t01_ccc_ob_record*************************************************************/
/*****************************************************************************************************/
INSERT INTO cust_call_ccc_record_agi_CUR_I (
unique_id /*呼入通话ID*/
,call_id /*CallID*/
,customer_number /*客户号码*/
,customer_province /*客户省份*/
,customer_city /*客户城市*/
,call_number /*座席电话*/
,call_cno /*座席工号*/
,call_cname /*座席姓名*/
,call_qname /*队列名称*/
,call_source_type /*呼叫来源类型*/
,call_type /*呼叫类型*/
,call_type_desc /*呼叫类型描述*/
,sip_cause_desc /*呼叫情况*/
,call_status /*接听状态*/
,call_result /*呼叫结果*/
,webrtc_call_id /*WebRTCCallID*/
,hotline_name /*热线别名*/
,on_hook_source /*挂断方*/
,investigation_keys /*满意度评价*/
,agent_answer_in_time /*首次及时应答*/
,evaluation /*是否邀评*/
,start_time /*开始时间*/
,ring_time /*振铃时间*/
,ib_ringing_duration /*振铃时长*/
,end_time /*结束时间*/
,answer_time /*接听时间*/
,offhook_time /*座席接起时间*/
,bridge_time /*首次接听时间*/
,bridge_duration /*通话时长*/
,total_duration /*总时长*/
,Etl_Batch_No /*作业批次号*/
,Etl_First_Dt /*最初入库时间*/
,Etl_Job /*作业名称*/
,Etl_Proc_Dt /*本次入库时间*/
,Etl_Tx_Dt /*作业运行时间*/
,Src_Sysname /*来源系统*/
,Src_Table /*来源表*/
)
SELECT
COALESCE(TRIM(p0.ob_unique_id),'') /*unique_id*/
,COALESCE(TRIM(p0.call_id),'') /*call_id*/
,COALESCE(TRIM(p0.customer_number),'') /*customer_number*/
,COALESCE(TRIM(p0.customer_province),'') /*customer_province*/
,COALESCE(TRIM(p0.customer_city),'') /*customer_city*/
,COALESCE(TRIM(p0.client_number),'') /*call_number*/
,COALESCE(TRIM(p0.cno),'') /*call_cno*/
,COALESCE(TRIM(p0.client_name),'') /*call_cname*/
,'' /*call_qname*/
,'OutBound' /*call_source_type*/
,COALESCE(TRIM(p0.call_type),'') /*call_type*/
,COALESCE(TRIM(p0.detail_call_type_desc),'') /*call_type_desc*/
,COALESCE(TRIM(p0.sip_cause_desc),'') /*sip_cause_desc*/
,COALESCE(TRIM(p0.status_desc),'') /*call_status*/
,COALESCE(TRIM(p0.ob_sip_cause),'') /*call_result*/
,COALESCE(TRIM(p0.webrtc_call_id),'') /*webrtc_call_id*/
,'' /*hotline_name*/
,COALESCE(TRIM(p0.on_hook_source),'') /*on_hook_source*/
,COALESCE(TRIM(p0.investigation_keys),'') /*investigation_keys*/
,'' /*agent_answer_in_time*/
,COALESCE(TRIM(p0.evaluation),'') /*evaluation*/
,COALESCE(p0.start_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*start_time*/
,COALESCE(p0.callee_ringing_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*ring_time*/
,COALESCE(p0.callee_ringing_duration,0) /*ib_ringing_duration*/
,COALESCE(p0.end_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*end_time*/
,COALESCE(p0.up_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*answer_time*/
,COALESCE(p0.up_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*offhook_time*/
,COALESCE(p0.bridge_time,TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*bridge_time*/
,COALESCE(p0.bridge_duration,0) /*bridge_duration*/
,COALESCE(p0.total_duration,0) /*total_duration*/
,0 /*Etl_Batch_No*/
,TO_DATE(:TXDATE,'YYYYMMDD') /*Etl_First_Dt*/
,:ETLJOB /*Etl_Job*/
,current_timestamp(0) /*Etl_Proc_Dt*/
,TO_DATE(:TXDATE,'YYYYMMDD') /*Etl_Tx_Dt*/
,Substr('t01_ccc_ob_record',1,3) /*Src_Sysname*/
,'t01_ccc_ob_record' /*Src_Table*/
FROM :PDMDB.t01_ccc_ob_record p0
;
/*将不同数据插入到临时表 */
;INSERT INTO cust_call_ccc_record_agi_INS (
customer_number /*客户号码*/
,customer_province /*客户省份*/
,customer_city /*客户城市*/
,call_number /*座席电话*/
,call_cno /*座席工号*/
,call_cname /*座席姓名*/
,call_qname /*队列名称*/
,call_source_type /*呼叫来源类型*/
,call_type /*呼叫类型*/
,call_type_desc /*呼叫类型描述*/
,sip_cause_desc /*呼叫情况*/
,call_status /*接听状态*/
,call_result /*呼叫结果*/
,webrtc_call_id /*WebRTCCallID*/
,hotline_name /*热线别名*/
,on_hook_source /*挂断方*/
,investigation_keys /*满意度评价*/
,agent_answer_in_time /*首次及时应答*/
,evaluation /*是否邀评*/
,start_time /*开始时间*/
,ring_time /*振铃时间*/
,ib_ringing_duration /*振铃时长*/
,end_time /*结束时间*/
,answer_time /*接听时间*/
,offhook_time /*座席接起时间*/
,bridge_time /*首次接听时间*/
,bridge_duration /*通话时长*/
,total_duration /*总时长*/
,unique_id /*呼入通话ID*/
,call_id /*CallID*/
,Etl_Batch_No /*作业批次号*/
,Etl_First_Dt /*最初入库时间*/
,Etl_Job /*作业名称*/
,Etl_Proc_Dt /*本次入库时间*/
,Etl_Tx_Dt /*作业运行时间*/
,Src_Sysname /*来源系统*/
,Src_Table /*来源表*/
)
SELECT
P1.customer_number /*客户号码*/
,P1.customer_province /*客户省份*/
,P1.customer_city /*客户城市*/
,P1.call_number /*座席电话*/
,P1.call_cno /*座席工号*/
,P1.call_cname /*座席姓名*/
,P1.call_qname /*队列名称*/
,P1.call_source_type /*呼叫来源类型*/
,P1.call_type /*呼叫类型*/
,P1.call_type_desc /*呼叫类型描述*/
,P1.sip_cause_desc /*呼叫情况*/
,P1.call_status /*接听状态*/
,P1.call_result /*呼叫结果*/
,P1.webrtc_call_id /*WebRTCCallID*/
,P1.hotline_name /*热线别名*/
,P1.on_hook_source /*挂断方*/
,P1.investigation_keys /*满意度评价*/
,P1.agent_answer_in_time /*首次及时应答*/
,P1.evaluation /*是否邀评*/
,P1.start_time /*开始时间*/
,P1.ring_time /*振铃时间*/
,P1.ib_ringing_duration /*振铃时长*/
,P1.end_time /*结束时间*/
,P1.answer_time /*接听时间*/
,P1.offhook_time /*座席接起时间*/
,P1.bridge_time /*首次接听时间*/
,P1.bridge_duration /*通话时长*/
,P1.total_duration /*总时长*/
,P1.unique_id /*呼入通话ID*/
,P1.call_id /*CallID*/
,P1.Etl_Batch_No /*作业批次号*/
,P1.Etl_First_Dt /*最初入库时间*/
,P1.Etl_Job /*作业名称*/
,P1.Etl_Proc_Dt /*本次入库时间*/
,P1.Etl_Tx_Dt /*作业运行时间*/
,P1.Src_Sysname /*来源系统*/
,P1.Src_Table /*来源表*/
FROM cust_call_ccc_record_agi_CUR_I P1
LEFT JOIN :COMMDB.cust_call_ccc_record P2
ON P1.customer_number = P2.customer_number
AND P1.customer_province = P2.customer_province
AND P1.customer_city = P2.customer_city
AND P1.call_number = P2.call_number
AND P1.call_cno = P2.call_cno
AND P1.call_cname = P2.call_cname
AND P1.call_qname = P2.call_qname
AND P1.call_source_type = P2.call_source_type
AND P1.call_type = P2.call_type
AND P1.call_type_desc = P2.call_type_desc
AND P1.sip_cause_desc = P2.sip_cause_desc
AND P1.call_status = P2.call_status
AND P1.call_result = P2.call_result
AND P1.webrtc_call_id = P2.webrtc_call_id
AND P1.hotline_name = P2.hotline_name
AND P1.on_hook_source = P2.on_hook_source
AND P1.investigation_keys = P2.investigation_keys
AND P1.agent_answer_in_time = P2.agent_answer_in_time
AND P1.evaluation = P2.evaluation
AND P1.start_time = P2.start_time
AND P1.ring_time = P2.ring_time
AND P1.ib_ringing_duration = P2.ib_ringing_duration
AND P1.end_time = P2.end_time
AND P1.answer_time = P2.answer_time
AND P1.offhook_time = P2.offhook_time
AND P1.bridge_time = P2.bridge_time
AND P1.bridge_duration = P2.bridge_duration
AND P1.total_duration = P2.total_duration
AND P1.unique_id = P2.unique_id
AND P1.call_id = P2.call_id
WHERE P2.customer_number IS NULL
OR P2.customer_province IS NULL
OR P2.customer_city IS NULL
OR P2.call_number IS NULL
OR P2.call_cno IS NULL
OR P2.call_cname IS NULL
OR P2.call_qname IS NULL
OR P2.call_source_type IS NULL
OR P2.call_type IS NULL
OR P2.call_type_desc IS NULL
OR P2.sip_cause_desc IS NULL
OR P2.call_status IS NULL
OR P2.call_result IS NULL
OR P2.webrtc_call_id IS NULL
OR P2.hotline_name IS NULL
OR P2.on_hook_source IS NULL
OR P2.investigation_keys IS NULL
OR P2.agent_answer_in_time IS NULL
OR P2.evaluation IS NULL
OR P2.start_time IS NULL
OR P2.ring_time IS NULL
OR P2.ib_ringing_duration IS NULL
OR P2.end_time IS NULL
OR P2.answer_time IS NULL
OR P2.offhook_time IS NULL
OR P2.bridge_time IS NULL
OR P2.bridge_duration IS NULL
OR P2.total_duration IS NULL
OR P2.unique_id IS NULL
OR P2.call_id IS NULL
;
/*将新增数据插入到目标表 */
;INSERT INTO :COMMDB.cust_call_ccc_record (
customer_number /*客户号码*/
,customer_province /*客户省份*/
,customer_city /*客户城市*/
,call_number /*座席电话*/
,call_cno /*座席工号*/
,call_cname /*座席姓名*/
,call_qname /*队列名称*/
,call_source_type /*呼叫来源类型*/
,call_type /*呼叫类型*/
,call_type_desc /*呼叫类型描述*/
,sip_cause_desc /*呼叫情况*/
,call_status /*接听状态*/
,call_result /*呼叫结果*/
,webrtc_call_id /*WebRTCCallID*/
,hotline_name /*热线别名*/
,on_hook_source /*挂断方*/
,investigation_keys /*满意度评价*/
,agent_answer_in_time /*首次及时应答*/
,evaluation /*是否邀评*/
,start_time /*开始时间*/
,ring_time /*振铃时间*/
,ib_ringing_duration /*振铃时长*/
,end_time /*结束时间*/
,answer_time /*接听时间*/
,offhook_time /*座席接起时间*/
,bridge_time /*首次接听时间*/
,bridge_duration /*通话时长*/
,total_duration /*总时长*/
,unique_id /*呼入通话ID*/
,call_id /*CallID*/
,Etl_Batch_No /*作业批次号*/
,Etl_First_Dt /*最初入库时间*/
,Etl_Job /*作业名称*/
,Etl_Proc_Dt /*本次入库时间*/
,Etl_Tx_Dt /*作业运行时间*/
,Src_Sysname /*来源系统*/
,Src_Table /*来源表*/
)
SELECT
P1.customer_number /*客户号码*/
,P1.customer_province /*客户省份*/
,P1.customer_city /*客户城市*/
,P1.call_number /*座席电话*/
,P1.call_cno /*座席工号*/
,P1.call_cname /*座席姓名*/
,P1.call_qname /*队列名称*/
,P1.call_source_type /*呼叫来源类型*/
,P1.call_type /*呼叫类型*/
,P1.call_type_desc /*呼叫类型描述*/
,P1.sip_cause_desc /*呼叫情况*/
,P1.call_status /*接听状态*/
,P1.call_result /*呼叫结果*/
,P1.webrtc_call_id /*WebRTCCallID*/
,P1.hotline_name /*热线别名*/
,P1.on_hook_source /*挂断方*/
,P1.investigation_keys /*满意度评价*/
,P1.agent_answer_in_time /*首次及时应答*/
,P1.evaluation /*是否邀评*/
,P1.start_time /*开始时间*/
,P1.ring_time /*振铃时间*/
,P1.ib_ringing_duration /*振铃时长*/
,P1.end_time /*结束时间*/
,P1.answer_time /*接听时间*/
,P1.offhook_time /*座席接起时间*/
,P1.bridge_time /*首次接听时间*/
,P1.bridge_duration /*通话时长*/
,P1.total_duration /*总时长*/
,P1.unique_id /*呼入通话ID*/
,P1.call_id /*CallID*/
,P1.Etl_Batch_No /*作业批次号*/
,P1.Etl_First_Dt /*最初入库时间*/
,P1.Etl_Job /*作业名称*/
,P1.Etl_Proc_Dt /*本次入库时间*/
,P1.Etl_Tx_Dt /*作业运行时间*/
,P1.Src_Sysname /*来源系统*/
,P1.Src_Table /*来源表*/
FROM cust_call_ccc_record_agi_INS P1
ON CONFLICT ( unique_id,call_id)
DO UPDATE SET
unique_id=excluded.unique_id
,call_id=excluded.call_id
,customer_number=excluded.customer_number
,customer_province=excluded.customer_province
,customer_city=excluded.customer_city
,call_number=excluded.call_number
,call_cno=excluded.call_cno
,call_cname=excluded.call_cname
,call_qname=excluded.call_qname
,call_source_type=excluded.call_source_type
,call_type=excluded.call_type
,call_type_desc=excluded.call_type_desc
,sip_cause_desc=excluded.sip_cause_desc
,call_status=excluded.call_status
,call_result=excluded.call_result
,webrtc_call_id=excluded.webrtc_call_id
,hotline_name=excluded.hotline_name
,on_hook_source=excluded.on_hook_source
,investigation_keys=excluded.investigation_keys
,agent_answer_in_time=excluded.agent_answer_in_time
,evaluation=excluded.evaluation
,start_time=excluded.start_time
,ring_time=excluded.ring_time
,ib_ringing_duration=excluded.ib_ringing_duration
,end_time=excluded.end_time
,answer_time=excluded.answer_time
,offhook_time=excluded.offhook_time
,bridge_time=excluded.bridge_time
,bridge_duration=excluded.bridge_duration
,total_duration=excluded.total_duration
,Etl_Batch_No=excluded.Etl_Batch_No
,Etl_First_Dt=excluded.Etl_First_Dt
,Etl_Job=excluded.Etl_Job
,Etl_Proc_Dt=excluded.Etl_Proc_Dt
,Etl_Tx_Dt=excluded.Etl_Tx_Dt
,Src_Sysname=excluded.Src_Sysname
,Src_Table=excluded.Src_Table
;
/*****程序结束退出 */
\q

View File

@ -147,6 +147,14 @@ params={'my_param':"t01_ccc_ob_record_agi"},
depends_on_past=False,
retries=3,
dag=dag)
cust_call_ccc_record = SSHOperator(
ssh_hook=sshHook,
task_id='cust_call_ccc_record',
command='/data/airflow/etl/COM/run_psql.sh {{ ds_nodash }} {{params.my_param}} >>/data/airflow/logs/run_tpt_{{ds_nodash}}.log 2>&1 ',
params={'my_param':"cust_call_ccc_record_agi"},
depends_on_past=False,
retries=3,
dag=dag)
cc_cdr_ib_agent_list_load >> tr_cc_cdr_ib_agent_list_9092
cc_cdr_ib_list_load >> tr_cc_cdr_ib_list_9521
cc_cdr_ob_list_load >> tr_cc_cdr_ob_list_4070
@ -155,4 +163,6 @@ tr_cc_cdr_ib_list_9521 >> t01_ccc_ib_record
tr_cc_cdr_ib_agent_list_9092 >> t01_ccc_ib_record
tr_cc_cdr_ob_list_4070 >> t01_ccc_ob_record
tr_cc_cdr_ob_detail_5097 >> t01_ccc_ob_record
t01_ccc_ob_record >> task_failed
t01_ccc_ib_record >> cust_call_ccc_record
t01_ccc_ob_record >> cust_call_ccc_record
cust_call_ccc_record >> task_failed