add workflow 泰克CRM,dev

This commit is contained in:
root 2024-04-19 15:28:00 +08:00
parent 170c8ca0e6
commit 8d20b15864
1 changed files with 99 additions and 99 deletions

View File

@ -4,7 +4,7 @@
/*Brilliance stems from wisdoms. */ /*Brilliance stems from wisdoms. */
/*************Head Section**************************************************************************/ /*************Head Section**************************************************************************/
/*Script Use: Periodically load data to :t01_crm_opportunity(CRM销售机会) */ /*Script Use: Periodically load data to :t01_crm_opportunity(CRM销售机会) */
/*Create Date:2024-04-19 11:51:17 */ /*Create Date:2024-04-19 15:27:22 */
/*SDM Developed By: dev */ /*SDM Developed By: dev */
/*SDM Developed Date: 2024-04-19 */ /*SDM Developed Date: 2024-04-19 */
/*SDM Checked By: dev */ /*SDM Checked By: dev */
@ -52,55 +52,55 @@ ON COMMIT PRESERVE ROWS;
/* GROUP 1:Source Table:s98_s_crm_opp*****************************************************************/ /* GROUP 1:Source Table:s98_s_crm_opp*****************************************************************/
/*****************************************************************************************************/ /*****************************************************************************************************/
INSERT INTO t01_crm_opportunity_agi_CUR_I ( INSERT INTO t01_crm_opportunity_agi_CUR_I (
tek_opportunitynumber /*tek_opportunitynumber*/ tek_opportunity_id /*泰克机会编号*/
,name /*name*/ ,opportunity_name /*机会名称*/
,tek_tektronixapname /*tek_tektronixapname*/ ,tektronix_apname /*tek_tektronixapname*/
,estimatedclosedate /*estimatedclosedate*/ ,estimated_close_time /*预期关闭时间*/
,parentaccountidname /*parentaccountidname*/ ,parent_account_name /*父账号名称*/
,parentcontactidname /*parentcontactidname*/ ,parent_contact_name /*父联系人名称*/
,tek_productidname /*tek_productidname*/ ,product_name /*产品名称*/
,tek_productfamilyidname /*tek_productfamilyidname*/ ,product_class /*产品类别*/
,transactioncurrencyidname /*transactioncurrencyidname*/ ,currency_name /*交易币种*/
,tek_unitpricetotal_base /*tek_unitpricetotal_base*/ ,uint_price /*单价*/
,tek_totaldiscountpercent /*tek_totaldiscountpercent*/ ,discount_percent /*折扣率*/
,totaldiscountamount_base /*totaldiscountamount_base*/ ,discount_amount_base /*基础折扣金额*/
,estimatedvalue_base /*estimatedvalue_base*/ ,base_amount /*基础金额*/
,totalamount /*totalamount*/ ,total_amount /*总金额*/
,tek_salesfunnelstagename /*tek_salesfunnelstagename*/ ,sales_funnel_stage /*销售漏斗层级*/
,tek_funnelstagenumber /*tek_funnelstagenumber*/ ,sales_funnel_stage_id /*销售漏斗层级编号*/
,statuscodename /*statuscodename*/ ,status /*状况*/
,statecodename /*statecodename*/ ,state /*状态*/
,tek_regionidname /*tek_regionidname*/ ,region /*区域*/
,tek_accountmanageridname /*tek_accountmanageridname*/ ,acount_manager /*账号经理*/
,tek_oppterritoryidname /*tek_oppterritoryidname*/ ,territory_id /*领域编号*/
,tek_opp_includeinforecastname /*tek_opp_includeinforecastname*/ ,forecast_opp_ind /*预期机会标志*/
,tek_isriskname /*tek_isriskname*/ ,risk_ind /*风险标志*/
,tek_opportunityage /*tek_opportunityage*/ ,opportunity_age /*机会年份*/
,createdon /*createdon*/ ,create_time /*创建时间*/
,createdbyname /*createdbyname*/ ,create_person /*创建人*/
,tek_piplinelastupdatedon /*tek_piplinelastupdatedon*/ ,pipline_last_update /*pipline最后更新时间*/
,tek_laststatusdate /*tek_laststatusdate*/ ,status_last_update /*状况最后更新时间*/
,tek_channelidname /*tek_channelidname*/ ,channel_id /*渠道编号*/
,tek_purchasemethodname /*tek_purchasemethodname*/ ,purchase_method /*采购方式*/
,campaignidname /*campaignidname*/ ,campaign_name /*活动名称*/
,tek_webvisitormedium /*tek_webvisitormedium*/ ,web_medium /*网络媒介*/
,tek_webvisitorsource /*tek_webvisitorsource*/ ,web_source /*网络来源*/
,tek_customerapplication /*tek_customerapplication*/ ,customer_app /*客户应用*/
,tek_vertical_segmentname /*tek_vertical_segmentname*/ ,vertical_segment /*垂直领域*/
,tek_competitivestatusname /*tek_competitivestatusname*/ ,competitive_status /*竞争状态*/
,tek_importantopportunityname /*tek_importantopportunityname*/ ,important_opportunity_ind /*重要机会标志*/
,tek_applicationidname /*tek_applicationidname*/ ,application_name /*应用名称*/
,tek_industryidname /*tek_industryidname*/ ,opp_industry /*行业opp)*/
,tek_taglist /*tek_taglist*/ ,tag_list /*标签列表*/
,discountamount /*discountamount*/ ,discount_amount /*折扣金额*/
,tek_terr_areaidname /*tek_terr_areaidname*/ ,area_id /*地区编号*/
,tek_terr_branchidname /*tek_terr_branchidname*/ ,branch_id /*分支编号*/
,tek_extension /*tek_extension*/ ,extension_id /*扩展编号*/
,tek_companynamelegal /*tek_companynamelegal*/ ,legal_company_name /*法定公司名称*/
,accountnumber /*accountnumber*/ ,account_number /*账号编号*/
,tek_marketing_program_type_idname /*tek_marketing_program_type_idname*/ ,marketing_program_type /*市场项目类型*/
,tek_leadnumber /*tek_leadnumber*/ ,lead_number /*线索编号*/
,tek_contactnumber /*tek_contactnumber*/ ,crm_contact_number /*联系人编号*/
,Scd_Start_Dt /*开始时间*/ ,Scd_Start_Dt /*开始时间*/
,Scd_End_Dt /*结束时间*/ ,Scd_End_Dt /*结束时间*/
,Etl_Batch_No /*作业批次号*/ ,Etl_Batch_No /*作业批次号*/
@ -112,55 +112,55 @@ INSERT INTO t01_crm_opportunity_agi_CUR_I (
,Src_Table /*来源表*/ ,Src_Table /*来源表*/
) )
SELECT SELECT
COALESCE(TRIM(p0.tek_opportunitynumber),'') /*tek_opportunitynumber*/ COALESCE(TRIM(CAST(p0.tek_opportunitynumber AS varchar(20))),'') /*tek_opportunity_id*/
,COALESCE(TRIM(p0.name),'') /*name*/ ,COALESCE(TRIM(CAST(p0.name AS varchar(100))),'') /*opportunity_name*/
,COALESCE(TRIM(p0.tek_tektronixapname),'') /*tek_tektronixapname*/ ,COALESCE(TRIM(p0.tek_tektronixapname),'') /*tektronix_apname*/
,COALESCE(TRIM(p0.estimatedclosedate),'') /*estimatedclosedate*/ ,COALESCE(TO_TIMESTAMP(CAST(p0.estimatedclosedate AS VARCHAR(19)),'YYYY-MM-DD HH24:mi:ss'),TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*estimated_close_time*/
,COALESCE(TRIM(p0.parentaccountidname),'') /*parentaccountidname*/ ,COALESCE(TRIM(CAST(p0.parentaccountidname AS varchar(200))),'') /*parent_account_name*/
,COALESCE(TRIM(p0.parentcontactidname),'') /*parentcontactidname*/ ,COALESCE(TRIM(CAST(p0.parentcontactidname AS varchar(20))),'') /*parent_contact_name*/
,COALESCE(TRIM(p0.tek_productidname),'') /*tek_productidname*/ ,COALESCE(TRIM(CAST(p0.tek_productidname AS varchar(50))),'') /*product_name*/
,COALESCE(TRIM(p0.tek_productfamilyidname),'') /*tek_productfamilyidname*/ ,COALESCE(TRIM(CAST(p0.tek_productfamilyidname AS varchar(50))),'') /*product_class*/
,COALESCE(TRIM(p0.transactioncurrencyidname),'') /*transactioncurrencyidname*/ ,COALESCE(TRIM(CAST(p0.transactioncurrencyidname AS varchar(20))),'') /*currency_name*/
,COALESCE(TRIM(p0.tek_unitpricetotal_base),'') /*tek_unitpricetotal_base*/ ,COALESCE(CAST(p0.tek_unitpricetotal_base AS int),0) /*uint_price*/
,COALESCE(TRIM(p0.tek_totaldiscountpercent),'') /*tek_totaldiscountpercent*/ ,COALESCE(CAST(p0.tek_totaldiscountpercent AS numeric(12,4)),0) /*discount_percent*/
,COALESCE(TRIM(p0.totaldiscountamount_base),'') /*totaldiscountamount_base*/ ,COALESCE(CAST(p0.totaldiscountamount_base AS numeric(16,4)),0) /*discount_amount_base*/
,COALESCE(TRIM(p0.estimatedvalue_base),'') /*estimatedvalue_base*/ ,COALESCE(CAST(p0.estimatedvalue_base AS numeric(16,4)),0) /*base_amount*/
,COALESCE(TRIM(p0.totalamount),'') /*totalamount*/ ,COALESCE(CAST(p0.totalamount AS numeric(16,4)),0) /*total_amount*/
,COALESCE(TRIM(p0.tek_salesfunnelstagename),'') /*tek_salesfunnelstagename*/ ,COALESCE(TRIM(CAST(p0.tek_salesfunnelstagename AS varchar(50))),'') /*sales_funnel_stage*/
,COALESCE(TRIM(p0.tek_funnelstagenumber),'') /*tek_funnelstagenumber*/ ,COALESCE(CAST(p0.tek_funnelstagenumber AS int),0) /*sales_funnel_stage_id*/
,COALESCE(TRIM(p0.statuscodename),'') /*statuscodename*/ ,COALESCE(TRIM(CAST(p0.statuscodename AS varchar(50))),'') /*status*/
,COALESCE(TRIM(p0.statecodename),'') /*statecodename*/ ,COALESCE(TRIM(CAST(p0.statecodename AS varchar(10))),'') /*state*/
,COALESCE(TRIM(p0.tek_regionidname),'') /*tek_regionidname*/ ,COALESCE(TRIM(CAST(p0.tek_regionidname AS varchar(10))),'') /*region*/
,COALESCE(TRIM(p0.tek_accountmanageridname),'') /*tek_accountmanageridname*/ ,COALESCE(TRIM(CAST(p0.tek_accountmanageridname AS varchar(20))),'') /*acount_manager*/
,COALESCE(TRIM(p0.tek_oppterritoryidname),'') /*tek_oppterritoryidname*/ ,COALESCE(TRIM(CAST(p0.tek_oppterritoryidname AS varchar(50))),'') /*territory_id*/
,COALESCE(TRIM(p0.tek_opp_includeinforecastname),'') /*tek_opp_includeinforecastname*/ ,COALESCE(TRIM(CAST(p0.tek_opp_includeinforecastname AS varchar(10))),'') /*forecast_opp_ind*/
,COALESCE(TRIM(p0.tek_isriskname),'') /*tek_isriskname*/ ,COALESCE(TRIM(CAST(p0.tek_isriskname AS varchar(10))),'') /*risk_ind*/
,COALESCE(TRIM(p0.tek_opportunityage),'') /*tek_opportunityage*/ ,COALESCE(CAST(p0.tek_opportunityage AS int),0) /*opportunity_age*/
,COALESCE(TRIM(p0.createdon),'') /*createdon*/ ,COALESCE(TO_TIMESTAMP(CAST(p0.createdon AS VARCHAR(19)),'YYYY-MM-DD HH24:mi:ss'),TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*create_time*/
,COALESCE(TRIM(p0.createdbyname),'') /*createdbyname*/ ,COALESCE(TRIM(CAST(p0.createdbyname AS varchar(50))),'') /*create_person*/
,COALESCE(TRIM(p0.tek_piplinelastupdatedon),'') /*tek_piplinelastupdatedon*/ ,COALESCE(TO_TIMESTAMP(CAST(p0.tek_piplinelastupdatedon AS VARCHAR(19)),'YYYY-MM-DD HH24:mi:ss'),TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*pipline_last_update*/
,COALESCE(TRIM(p0.tek_laststatusdate),'') /*tek_laststatusdate*/ ,COALESCE(TO_TIMESTAMP(CAST(p0.tek_laststatusdate AS VARCHAR(19)),'YYYY-MM-DD HH24:mi:ss'),TO_TIMESTAMP(:NULLDATE,'YYYYMMDD')) /*status_last_update*/
,COALESCE(TRIM(p0.tek_channelidname),'') /*tek_channelidname*/ ,COALESCE(TRIM(CAST(p0.tek_channelidname AS varchar(50))),'') /*channel_id*/
,COALESCE(TRIM(p0.tek_purchasemethodname),'') /*tek_purchasemethodname*/ ,COALESCE(TRIM(CAST(p0.tek_purchasemethodname AS varchar(50))),'') /*purchase_method*/
,COALESCE(TRIM(p0.campaignidname),'') /*campaignidname*/ ,COALESCE(TRIM(CAST(p0.campaignidname AS varchar(50))),'') /*campaign_name*/
,COALESCE(TRIM(p0.tek_webvisitormedium),'') /*tek_webvisitormedium*/ ,COALESCE(TRIM(CAST(p0.tek_webvisitormedium AS varchar(50))),'') /*web_medium*/
,COALESCE(TRIM(p0.tek_webvisitorsource),'') /*tek_webvisitorsource*/ ,COALESCE(TRIM(CAST(p0.tek_webvisitorsource AS varchar(100))),'') /*web_source*/
,COALESCE(TRIM(p0.tek_customerapplication),'') /*tek_customerapplication*/ ,COALESCE(TRIM(CAST(p0.tek_customerapplication AS varchar(50))),'') /*customer_app*/
,COALESCE(TRIM(p0.tek_vertical_segmentname),'') /*tek_vertical_segmentname*/ ,COALESCE(TRIM(CAST(p0.tek_vertical_segmentname AS varchar(50))),'') /*vertical_segment*/
,COALESCE(TRIM(p0.tek_competitivestatusname),'') /*tek_competitivestatusname*/ ,COALESCE(TRIM(CAST(p0.tek_competitivestatusname AS varchar(50))),'') /*competitive_status*/
,COALESCE(TRIM(p0.tek_importantopportunityname),'') /*tek_importantopportunityname*/ ,COALESCE(TRIM(CAST(p0.tek_importantopportunityname AS varchar(10))),'') /*important_opportunity_ind*/
,COALESCE(TRIM(p0.tek_applicationidname),'') /*tek_applicationidname*/ ,COALESCE(TRIM(CAST(p0.tek_applicationidname AS varchar(100))),'') /*application_name*/
,COALESCE(TRIM(p0.tek_industryidname),'') /*tek_industryidname*/ ,COALESCE(TRIM(CAST(p0.tek_industryidname AS varchar(100))),'') /*opp_industry*/
,COALESCE(TRIM(p0.tek_taglist),'') /*tek_taglist*/ ,COALESCE(TRIM(CAST(p0.tek_taglist AS varchar(100))),'') /*tag_list*/
,COALESCE(TRIM(p0.discountamount),'') /*discountamount*/ ,COALESCE(CAST(p0.discountamount AS numeric(16,4)),0) /*discount_amount*/
,COALESCE(TRIM(p0.tek_terr_areaidname),'') /*tek_terr_areaidname*/ ,COALESCE(TRIM(CAST(p0.tek_terr_areaidname AS varchar(100))),'') /*area_id*/
,COALESCE(TRIM(p0.tek_terr_branchidname),'') /*tek_terr_branchidname*/ ,COALESCE(TRIM(CAST(p0.tek_terr_branchidname AS varchar(100))),'') /*branch_id*/
,COALESCE(TRIM(p0.tek_extension),'') /*tek_extension*/ ,COALESCE(TRIM(CAST(p0.tek_extension AS varchar(100))),'') /*extension_id*/
,COALESCE(TRIM(p0.tek_companynamelegal),'') /*tek_companynamelegal*/ ,COALESCE(TRIM(CAST(p0.tek_companynamelegal AS varchar(200))),'') /*legal_company_name*/
,COALESCE(TRIM(p0.accountnumber),'') /*accountnumber*/ ,COALESCE(TRIM(CAST(p0.accountnumber AS varchar(100))),'') /*account_number*/
,COALESCE(TRIM(p0.tek_marketing_program_type_idname),'') /*tek_marketing_program_type_idname*/ ,COALESCE(TRIM(CAST(p0.tek_marketing_program_type_idname AS varchar(100))),'') /*marketing_program_type*/
,COALESCE(TRIM(p0.tek_leadnumber),'') /*tek_leadnumber*/ ,COALESCE(TRIM(CAST(p0.tek_leadnumber AS varchar(20))),'') /*lead_number*/
,COALESCE(TRIM(p0.tek_contactnumber),'') /*tek_contactnumber*/ ,COALESCE(TRIM(CAST(p0.tek_contactnumber AS varchar(20))),'') /*crm_contact_number*/
,COALESCE(p0.Scd_Start_Dt,TO_DATE(:NULLDATE,'YYYYMMDD')) /*Scd_Start_Dt*/ ,COALESCE(p0.Scd_Start_Dt,TO_DATE(:NULLDATE,'YYYYMMDD')) /*Scd_Start_Dt*/
,COALESCE(p0.Scd_End_Dt,TO_DATE(:NULLDATE,'YYYYMMDD')) /*Scd_End_Dt*/ ,COALESCE(p0.Scd_End_Dt,TO_DATE(:NULLDATE,'YYYYMMDD')) /*Scd_End_Dt*/
,0 /*Etl_Batch_No*/ ,0 /*Etl_Batch_No*/