diff --git a/dev/workflow/TK_Cust/tk_crm/CRM联系信息/d_crm_contact_agi.sql b/dev/workflow/TK_Cust/tk_crm/CRM联系信息/d_crm_contact_agi.sql index 39631fa..671e647 100644 --- a/dev/workflow/TK_Cust/tk_crm/CRM联系信息/d_crm_contact_agi.sql +++ b/dev/workflow/TK_Cust/tk_crm/CRM联系信息/d_crm_contact_agi.sql @@ -4,7 +4,7 @@ /*Brilliance stems from wisdoms. */ /*************Head Section**************************************************************************/ /*Script Use: Periodically load data to :d_crm_contact(CRM联系信息) */ -/*Create Date:2024-04-29 13:48:36 */ +/*Create Date:2024-04-29 13:51:17 */ /*SDM Developed By: dev */ /*SDM Developed Date: 2024-01-18 */ /*SDM Checked By: dev */ @@ -115,12 +115,14 @@ SELECT ,COALESCE(TRIM(p0.owner_id),'') /*owner_id*/ ,0 /*full_name*/ ,case when mobile_phone ~ '^1[3-9]\d{9}$' then mobile_phone - when telphone ~ '^1[3-9]\d{9}$' then replace(replace(telphone1,'+86 ',''),' ','') else mobile_phone end /*mobile_phone*/ - ,0 /*mobile_phone_data_ind*/ - ,0 /*mobile_phone_availability*/ + when telphone ~ '^1[3-9]\d{9}$' then replace(replace(telphone,'+86 ',''),' ','') else mobile_phone end /*mobile_phone*/ + ,case when length(replace(replace(mobile_phone,'+86 ',''),' ',''))>1 then '1' else 0 end /*mobile_phone_data_ind*/ + ,case when replace(replace(mobile_phone,'+86 ',''),' ','') ~ '^1[3-9]\d{9}$' then '1' + when replace(replace(telphone,'+86 ',''),' ','') ~ '^1[3-9]\d{9}$' then '1' else '0' end /*mobile_phone_availability*/ ,COALESCE(TRIM(p0.email),'') /*email*/ - ,0 /*email_data_ind*/ - ,0 /*email_availability*/ + ,case when length(email)>1 then '1' else 0 end /*email_data_ind*/ + ,case when email ~ '[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$' and length(email)>10 then '1' + else '0' end /*email_availability*/ ,COALESCE(TRIM(p0.cust_dept),'') /*cust_dept*/ ,COALESCE(TRIM(p0.cust_title),'') /*cust_title*/ ,COALESCE(TRIM(p0.job_function),'') /*job_function*/