|
@@ -4,73 +4,72 @@
|
|
|
|
|
|
<insert id="etlKuaishouAccountMaterialReportDailyData">
|
|
|
replace into ctop_etl_kuaishou_account_material_report_daily (
|
|
|
- company_id ,
|
|
|
- company_name ,
|
|
|
- project_id ,
|
|
|
+ company_id,
|
|
|
+ company_name,
|
|
|
+ project_id,
|
|
|
project_name,
|
|
|
account_id,
|
|
|
signature,
|
|
|
- charge ,
|
|
|
- photo_show ,
|
|
|
- aclick ,
|
|
|
- bclick ,
|
|
|
- download_started ,
|
|
|
- download_completed ,
|
|
|
- activation ,
|
|
|
- submit ,
|
|
|
- stat_date ,
|
|
|
- photo_click ,
|
|
|
- event_pay_first_day ,
|
|
|
- event_pay_purchase_amount_first_day ,
|
|
|
- event_pay ,
|
|
|
- event_pay_purchase_amount ,
|
|
|
- event_register ,
|
|
|
- event_jin_jian_app ,
|
|
|
- event_credit_grant_app ,
|
|
|
- event_order_paid ,
|
|
|
- event_order_paid_purchase_amount ,
|
|
|
- event_jin_jian_landing_page ,
|
|
|
- event_credit_grant_landing_page ,
|
|
|
- event_next_day_stay ,
|
|
|
- form_count,
|
|
|
- play_3s_count)
|
|
|
- select
|
|
|
- c.company_id ,
|
|
|
- c.company_name ,
|
|
|
- u.project_id ,
|
|
|
- p.project_name,
|
|
|
- m.account_id,
|
|
|
- m.signature,
|
|
|
- sum(m.charge)as charge ,
|
|
|
- sum(m.photo_show)as photo_show ,
|
|
|
- sum(m.aclick)as aclick ,
|
|
|
- sum(m.bclick)as bclick ,
|
|
|
- sum(m.download_started)as download_started ,
|
|
|
- sum(m.download_completed)as download_completed,
|
|
|
- sum(m.activation)as activation ,
|
|
|
- sum(m.submit)as submit,
|
|
|
- stat_date,
|
|
|
- sum(m.photo_click)as photo_click,
|
|
|
- sum(m.event_pay_first_day)as event_pay_first_day,
|
|
|
- sum(m.event_pay_purchase_amount_first_day)as event_pay_purchase_amount_first_day,
|
|
|
- sum(m.event_pay)as event_pay,
|
|
|
- sum(m.event_pay_purchase_amount)as event_pay_purchase_amount,
|
|
|
- sum(m.event_register)as event_register,
|
|
|
- sum(m.event_jin_jian_app)as event_jin_jian_app,
|
|
|
- sum(m.event_credit_grant_app)as event_credit_grant_app,
|
|
|
- sum(m.event_order_paid)as event_order_paid,
|
|
|
- sum(m.event_order_paid_purchase_amount)as event_order_paid_purchase_amount,
|
|
|
- sum(m.event_jin_jian_landing_page)as event_jin_jian_landing_page,
|
|
|
- sum(m.event_credit_grant_landing_page )as event_credit_grant_landing_page,
|
|
|
- sum(m.event_next_day_stay)as event_next_day_stay,
|
|
|
- sum(m.form_count)as form_count,
|
|
|
- round(sum(m.play_3s_ratio*m.photo_show))as play_3s_count
|
|
|
- from ctop_kuaishou_report_daily_material m left join ctop_user_allocation u on u.account_id = m.account_id
|
|
|
-left join ctop_project p on p.id = u.project_id
|
|
|
-left join user_company c on c.user_id = u.account_id
|
|
|
-where m.signature is not null
|
|
|
-and m.stat_date = #{date}
|
|
|
-group by m.account_id,m.signature
|
|
|
+ charge,
|
|
|
+ photo_show,
|
|
|
+ aclick,
|
|
|
+ bclick,
|
|
|
+ download_started,
|
|
|
+ download_completed,
|
|
|
+ activation,
|
|
|
+ submit,
|
|
|
+ stat_date,
|
|
|
+ photo_click,
|
|
|
+ event_pay_first_day ,
|
|
|
+ event_pay_purchase_amount_first_day,
|
|
|
+ event_pay,
|
|
|
+ event_pay_purchase_amount,
|
|
|
+ event_register,
|
|
|
+ event_jin_jian_app,
|
|
|
+ event_credit_grant_app,
|
|
|
+ event_order_paid,
|
|
|
+ event_order_paid_purchase_amount,
|
|
|
+ event_jin_jian_landing_page,
|
|
|
+ event_credit_grant_landing_page,
|
|
|
+ event_next_day_stay,
|
|
|
+ form_count)
|
|
|
+ select
|
|
|
+ c.company_id,
|
|
|
+ c.company_name,
|
|
|
+ u.project_id,
|
|
|
+ p.project_name,
|
|
|
+ m.account_id,
|
|
|
+ m.signature,
|
|
|
+ sum(m.charge) as charge,
|
|
|
+ sum(m.photo_show) as photo_show,
|
|
|
+ sum(m.aclick) as aclick,
|
|
|
+ sum(m.bclick) as bclick,
|
|
|
+ sum(m.download_started) as download_started ,
|
|
|
+ sum(m.download_completed) as download_completed,
|
|
|
+ sum(m.activation) as activation,
|
|
|
+ sum(m.submit) as submit,
|
|
|
+ stat_date,
|
|
|
+ sum(m.photo_click) as photo_click,
|
|
|
+ sum(m.event_pay_first_day) as event_pay_first_day,
|
|
|
+ sum(m.event_pay_purchase_amount_first_day) as event_pay_purchase_amount_first_day,
|
|
|
+ sum(m.event_pay) as event_pay,
|
|
|
+ sum(m.event_pay_purchase_amount) as event_pay_purchase_amount,
|
|
|
+ sum(m.event_register) as event_register,
|
|
|
+ sum(m.event_jin_jian_app) as event_jin_jian_app,
|
|
|
+ sum(m.event_credit_grant_app) as event_credit_grant_app,
|
|
|
+ sum(m.event_order_paid) as event_order_paid,
|
|
|
+ sum(m.event_order_paid_purchase_amount) as event_order_paid_purchase_amount,
|
|
|
+ sum(m.event_jin_jian_landing_page) as event_jin_jian_landing_page,
|
|
|
+ sum(m.event_credit_grant_landing_page) as event_credit_grant_landing_page,
|
|
|
+ sum(m.event_next_day_stay) as event_next_day_stay,
|
|
|
+ sum(m.form_count)as form_count
|
|
|
+
|
|
|
+ from ctop_kuaishou_report_daily_material m left join ctop_user_allocation u on u.account_id = m.account_id
|
|
|
+ left join ctop_project p on p.id = u.project_id
|
|
|
+ left join user_company c on c.user_id = u.account_id
|
|
|
+ where m.signature is not null
|
|
|
+ and m.stat_date = #{date}
|
|
|
+ group by m.account_id,m.signature
|
|
|
</insert>
|
|
|
<insert id="replaceBatch">
|
|
|
replace into ctop_etl_kuaishou_account_material_report_daily(
|