diff --git a/dev/workflow/TK_Cust/tk_crm/CRM联系方式/t01_crm_contact_agi.sql b/dev/workflow/TK_Cust/tk_crm/CRM联系方式/t01_crm_contact_agi.sql index ae984f7..d9b96c1 100644 --- a/dev/workflow/TK_Cust/tk_crm/CRM联系方式/t01_crm_contact_agi.sql +++ b/dev/workflow/TK_Cust/tk_crm/CRM联系方式/t01_crm_contact_agi.sql @@ -1,14 +1,14 @@ /***************************************************************************************************/ -/*script in Sql, generate by SdmCreateScript 2020(by Qihang Feng, QF255001@TERADATA.COM) */ +/*script in Sql, generate by SdmCreateScript 2024(by IdgValue, qihang.feng@idgvalue.COM) */ /*VERSION 01.10 revised on 2020-08-25 */ /*Brilliance stems from wisdoms. */ /*************Head Section**************************************************************************/ /*Script Use: Periodically load data to :t01_crm_contact(CRM联系方式) */ -/*Create Date:2024-05-10 16:27:03 */ +/*Create Date:2025-11-11 18:45:38 */ /*SDM Developed By: dev */ /*SDM Developed Date: 2024-01-12 */ /*SDM Checked By: dev */ -/*SDM Checked Date: 2024-05-10 */ +/*SDM Checked Date: 2025-11-11 */ /*Script Developed By: dev */ /*Script Checked By: dev */ /*Source table 1: p10_sa.s98_s_crm_contact_part */ @@ -30,7 +30,7 @@ CREATE TEMPORARY TABLE t01_crm_contact_agi_CUR_I ( LIKE :PDMDB.t01_crm_contact) ON COMMIT PRESERVE ROWS; - + /*创建临时表加载不同数据 */ CREATE TEMPORARY TABLE t01_crm_contact_agi_INS @@ -129,11 +129,11 @@ SELECT ,COALESCE(TRIM(CAST(p0.tek_ccpapplication AS varchar(200))),'') /*ccp_app*/ ,COALESCE(TRIM(CAST(p0.tek_ccpproductinterest AS varchar(200))),'') /*product_interst*/ ,COALESCE(TO_TIMESTAMP(CAST(p0.tek_acquisitiondate AS VARCHAR(19)),'YYYY/MM/DD HH24:mi:ss'),TO_TIMESTAMP('19000102','YYYYMMDD')) /*acq_time*/ - ,COALESCE(cast(p0.tek_countofactivepartnerleads AS int),0) /*active_leads_count*/ - ,COALESCE(CAST(p0.tek_countofapplication2 AS int),0) /*app_count*/ - ,COALESCE(CAST(p0.tek_recordcountccp AS int),0) /*ccp_record_count*/ - ,COALESCE(CAST(p0.tek_countofgeneralproductinterest2 AS int),0) /*gen_product_interst_count*/ - ,COALESCE(CAST(p0.tek_countofsubapplication2 AS int),0) /*sub_app_count*/ + ,COALESCE(cast(cast(p0.tek_countofactivepartnerleads as numeric) AS int),0) /*active_leads_count*/ + ,COALESCE(cast(CAST(p0.tek_countofapplication2 as numeric) AS int),0) /*app_count*/ + ,COALESCE(cast(CAST(p0.tek_recordcountccp as numeric) AS int),0) /*ccp_record_count*/ + ,COALESCE(cast(CAST(p0.tek_countofgeneralproductinterest2 as numeric) AS int),0) /*gen_product_interst_count*/ + ,COALESCE(cast(CAST(p0.tek_countofsubapplication2 as numeric) AS int),0) /*sub_app_count*/ ,COALESCE(TRIM(CAST(p0.tek_acquisitioncampaignidname AS varchar(200))),'') /*acq_campaign_name*/ ,COALESCE(TO_TIMESTAMP(CAST(p0.createdon AS VARCHAR(19)),'YYYY/MM/DD HH24:mi:ss'),TO_TIMESTAMP('19000102','YYYYMMDD')) /*create_time*/ ,COALESCE(TRIM(CAST(p0.createdbyname AS varchar(50))),'') /*create_person*/ @@ -143,7 +143,7 @@ SELECT ,COALESCE(TRIM(CAST(p0.tek_subindustry2idname AS varchar(50))),'') /*sub_industry*/ ,COALESCE(TRIM(CAST(p0.tek_msr_visibilityname AS varchar(20))),'') /*msr_visibility*/ ,COALESCE(TRIM(CAST(p0.tek_agreestoprivacypolicytermsname AS varchar(20))),'') /*privacy_policy_ind*/ - ,COALESCE(CAST(p0.tek_contactscoringrollup AS int),0) /*contact_score*/ + ,COALESCE(cast(CAST(p0.tek_contactscoringrollup as numeric) AS int),0) /*contact_score*/ ,COALESCE(TRIM(CAST(p0.tek_contactstagecodename AS varchar(50))),'') /*contact_stage*/ ,COALESCE(TRIM(CAST(p0.tek_contacttypename AS varchar(20))),'') /*contact_type*/ ,COALESCE(TRIM(CAST(p0.tek_consent_tocollectpersonalinfoname AS varchar(20))),'') /*collect_personal_info_ind*/