add workflow 天润Smart-ccc通话记录,dev
This commit is contained in:
parent
cc02dbf2cc
commit
7a3eea1dd8
|
@ -4,14 +4,14 @@
|
|||
/*Brilliance stems from wisdoms. */
|
||||
/*************Head Section**************************************************************************/
|
||||
/*Script Use: Periodically load data to :cust_call_record_info(ccc客户通话记录信息) */
|
||||
/*Create Date:2024-09-19 19:37:16 */
|
||||
/*Create Date:2024-09-23 15:50:38 */
|
||||
/*SDM Developed By: dev */
|
||||
/*SDM Developed Date: 2024-09-19 */
|
||||
/*SDM Checked By: dev */
|
||||
/*SDM Checked Date: 2024-09-19 */
|
||||
/*SDM Checked Date: 2024-09-23 */
|
||||
/*Script Developed By: dev */
|
||||
/*Script Checked By: dev */
|
||||
/*Source table 1: :COMMDB.d_ccc_cust_info */
|
||||
/*Source table 1: :COMMDB.select distinct on (tel) * from p30_common.d_ccc_cust_info */
|
||||
/*Source table 2: :PDMDB.t01_udesk_record */
|
||||
/*Source table 3: :COMMDB.cust_call_ccc_record */
|
||||
/*Job Type: Inbound transform (Tier 1 to Tier 2) */
|
||||
|
@ -67,7 +67,7 @@ SELECT
|
|||
,coalesce(p1.company,'') /*company*/
|
||||
|
||||
FROM :COMMDB.cust_call_ccc_record p0
|
||||
LEFT JOIN :COMMDB.d_ccc_cust_info p1
|
||||
LEFT JOIN (select distinct on (tel) * from p30_common.d_ccc_cust_info) p1
|
||||
ON p0.customer_number =p1.tel
|
||||
where p0.hotline_name in ('400呼入','Inbound','SG-TSC')
|
||||
|
||||
|
@ -78,6 +78,7 @@ where p0.hotline_name in ('400呼入','Inbound','SG-TSC')
|
|||
/*****************************************************************************************************/
|
||||
/* GROUP 2:Source Table:t01_udesk_record**************************************************************/
|
||||
/*****************************************************************************************************/
|
||||
|
||||
INSERT INTO cust_call_record_info_agi_CUR_I (
|
||||
call_id /*通话编号*/
|
||||
,call_channel /*通话渠道*/
|
||||
|
@ -94,8 +95,8 @@ SELECT
|
|||
COALESCE(TRIM(p0.call_id),'') /*call_id*/
|
||||
,'Udesk' /*call_channel*/
|
||||
,p0.record_time /*start_time*/
|
||||
,extract (epoch from p0.duration::time) /*bridge_duration*/
|
||||
,p0.udesk_source /*call_qname*/
|
||||
,extract (epoch from duration::time) /*bridge_duration*/
|
||||
,udesk_source /*call_qname*/
|
||||
,case when udesk_source ='队列: IAM' then '产品报价'
|
||||
when udesk_source in ('队列: TSC-KEI','队列: TSC-TEK') then '技术支持'
|
||||
when udesk_source ='队列: SSO-TEK' then '维修与校准'
|
||||
|
@ -104,9 +105,13 @@ else '其他' end /*service_group*/
|
|||
,COALESCE(TRIM(p0.mobile_phone),'') /*customer_number*/
|
||||
,cust /*name*/
|
||||
,'' /*email*/
|
||||
,COALESCE(TRIM(CAST(p0.company_name AS VARCHAR(200))),'') /*company*/
|
||||
,company_name /*company*/
|
||||
|
||||
FROM :PDMDB.t01_udesk_record p0
|
||||
where p0.type = '呼入' and p0.relay_number not like '%MKT%' and p0.relay_number not like '%Fluke%' and record_time ::date >='2024-01-01'
|
||||
and udesk_source in ('队列: IAM','队列: SSO-TEK','队列: TSC-KEI','队列: TSC-TEK')
|
||||
and udesk_source in ('队列: IAM','队列: SSO-TEK','队列: TSC-KEI','队列: TSC-TEK');
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue