
DROP TABLE IF EXISTS p20_pdm.t01_crm_contact;
CREATE TABLE IF NOT EXISTS p20_pdm.t01_crm_contact (
	 crm_contact_account  varchar(20) 
	, company_name  varchar(50) 
	, account_name  varchar(50) 
	, owner_id  varchar(30) 
	, first_name  varchar(20) 
	, last_name  varchar(20) 
	, mobile_phone  varchar(20) 
	, telphone  varchar(20) 
	, email  varchar(50) 
	, cust_dept  varchar(50) 
	, cust_title  varchar(50) 
	, job_function  varchar(50) 
	, suffix_info  varchar(50) 
	, address_detail  varchar(50) 
	, city_name  varchar(20) 
	, prov_name  varchar(20) 
	, post_cd  varchar(20) 
	, country_name  varchar(20) 
	, ccp_app  varchar(200) 
	, product_interst  varchar(200) 
	, acq_time  timestamp(0) 
	, active_leads_count  int 
	, app_count  int 
	, ccp_record_count  text 
	, gen_product_interst_count  int 
	, sub_app_count  int 
	, acq_campaign_name  varchar(200) 
	, create_time  timestamp(0) 
	, create_person  varchar(50) 
	, modify_time  timestamp(0) 
	, modify_person  varchar(50) 
	, industry  varchar(50) 
	, sub_industry  varchar(50) 
	, msr_visibility  varchar(20) 
	, privacy_policy_ind  varchar(20) 
	, contact_score  int 
	, contact_stage  varchar(50) 
	, contact_type  varchar(20) 
	, collect_personal_info_ind  varchar(20) 
	, collect_personal_info_time  timestamp(0) 
	, phone_ind  varchar(20) 
	, bulk_postalmail_ind  varchar(20) 
	, fax_ind  varchar(20) 
	, track_ind  varchar(20) 
	, set_up_ind  varchar(20) 
	, bulk_email_ind  varchar(20) 
	, email_permission_time  timestamp(0) 
	, sms_ind  varchar(20) 
	, sms_permission_time  timestamp(0) 
	, telmarker_permission_time  timestamp(0) 
	, industry_or_application_info  varchar(20) 
	, last_activity  varchar(20) 
	, market_ind  varchar(20) 
	, marketing_consent  varchar(20) 
	, marketing_consent_time  timestamp(0) 
	, state  varchar(20) 
	, Etl_Batch_No  varchar(50) 
	, Etl_First_Dt  timestamp(0) 
	, Etl_Job  varchar(50) 
	, Etl_Proc_Dt  timestamp(0) 
	, Etl_Tx_Dt  timestamp(0) 
	, Src_Sysname  varchar(50) 
	, Src_Table  varchar(50) 
	,primary key( crm_contact_account )
);

 COMMENT ON COLUMN p20_pdm.t01_crm_contact.crm_contact_account IS 'CRM_CONTACT账号'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.company_name IS '公司名称'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.account_name IS '账号名称'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.owner_id IS '责任人'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.first_name IS '姓'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.last_name IS '名'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.mobile_phone IS '手机号'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.telphone IS '电话号码'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.email IS '电子邮箱'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.cust_dept IS '部门'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.cust_title IS '职位'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.job_function IS '工作领域'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.suffix_info IS '附加信息'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.address_detail IS '详细地址'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.city_name IS '城市'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.prov_name IS '省份'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.post_cd IS '邮编'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.country_name IS '国家'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.ccp_app IS 'CCP应用'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.product_interst IS '产品偏好'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.acq_time IS '购买时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.active_leads_count IS '活动线索数'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.app_count IS '应用数'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.ccp_record_count IS 'CCP记录数'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.gen_product_interst_count IS '通用产品偏好数'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.sub_app_count IS '子应用数'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.acq_campaign_name IS '购买项目名'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.create_time IS '创建时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.create_person IS '创建人'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.modify_time IS '修改时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.modify_person IS '修改人'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.industry IS '行业'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.sub_industry IS '子行业'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.msr_visibility IS 'msr关注度'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.privacy_policy_ind IS '隐私政策同意标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.contact_score IS '联系评分'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.contact_stage IS '联系层次'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.contact_type IS '联系类型'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.collect_personal_info_ind IS '个人信息收集标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.collect_personal_info_time IS '个人信息收集时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.phone_ind IS '电话标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.bulk_postalmail_ind IS '群发邮件标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.fax_ind IS '传真标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.track_ind IS '追踪标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.set_up_ind IS '创建标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.bulk_email_ind IS '群发电子邮件标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.email_permission_time IS '电子邮件权限时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.sms_ind IS '短信标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.sms_permission_time IS '短信权限时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.telmarker_permission_time IS '电话营销权限时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.industry_or_application_info IS '行业或应用标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.last_activity IS '最近活跃'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.market_ind IS '市场营销标志'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.marketing_consent IS '营销同意书'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.marketing_consent_time IS '营销同意时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.state IS '状态'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.Etl_Batch_No IS '作业批次号'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.Etl_First_Dt IS '最初入库时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.Etl_Job IS '作业名称'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.Etl_Proc_Dt IS '本次入库时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.Etl_Tx_Dt IS '作业运行时间'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.Src_Sysname IS '来源系统'; 
 COMMENT ON COLUMN p20_pdm.t01_crm_contact.Src_Table IS '来源表'; 

COMMENT ON TABLE p20_pdm.t01_crm_contact IS 'CRM联系方式';