|
@@ -6,52 +6,74 @@
|
|
|
<!-- 查询快手组 时报 消耗前10 -->
|
|
|
<select id="getKuaishouUnitReportHourly" resultType="org.jeecg.ctop.material.entity.KuaishouUnitReportHourlyPojo">
|
|
|
SELECT
|
|
|
- unit_id AS unitId,
|
|
|
- unit_name as unitName,
|
|
|
- aclick as aclick,
|
|
|
- bclick as bclick,
|
|
|
- charge as cost,
|
|
|
- `show` as photoShow,
|
|
|
- photo_click_ratio as clickRate,
|
|
|
- action_ratio as bClickRate,
|
|
|
- impression_1k_cost as cpm,
|
|
|
- photo_click_cost as cpc,
|
|
|
- action_cost as cpb,
|
|
|
- download_started as downloadStart,
|
|
|
- download_completed as downloadFinish,
|
|
|
- activation as active,
|
|
|
- event_pay_first_day as firstDayPay,
|
|
|
- event_pay_purchase_amount_first_day as firstDayPayAmount,
|
|
|
- event_pay_first_day_roi as firstDayPayROI,
|
|
|
- event_pay_roi as ROI,
|
|
|
- event_register as register,
|
|
|
- event_register_cost as activeRegisterCost,
|
|
|
- event_register_ratio as activeRegisterRate,
|
|
|
- event_next_day_stay as nextDayOpen,
|
|
|
- event_next_day_stay_cost as nextDayOpenCost,
|
|
|
- event_next_day_stay_ratio as nextDayOpenRate,
|
|
|
- event_credit_grant_landing_page_ratio as eventCreditGrantLandingPageRate,
|
|
|
- play_3s_ratio as play3sRate,
|
|
|
- form_cost as formCountCost,
|
|
|
- form_action_ratio as formCountRate,
|
|
|
- event_button_click_cost as submitCost,
|
|
|
- event_button_click_ratio as submitRate,
|
|
|
- charge as cost,
|
|
|
- `show` as photoShow,
|
|
|
- CONCAT(ROUND(download_started / bclick * 100,2) ,'%') as downloadStartRate,
|
|
|
- ROUND(download_started / bclick * 100,2) as downloadStartCost,
|
|
|
- CONCAT(ROUND(download_completed / download_started * 100,2) ,'%') as downloadFinishRate,
|
|
|
- ROUND(charge / download_completed * 100,2) as downloadFinishCost,
|
|
|
- ROUND(charge / activation * 100,2) as activeCost,
|
|
|
- CONCAT(ROUND(activation / download_completed * 100,2) ,'%') as activeRate,
|
|
|
- ROUND(charge / event_pay_first_day * 100,2) as firstDayPayCost
|
|
|
+ unit_id,
|
|
|
+ unit_name,
|
|
|
+ sum( aclick ) AS aClick,
|
|
|
+ sum( bclick ) AS bClick,
|
|
|
+ sum( charge ) AS cost,
|
|
|
+ sum( `show` ) AS photoShow,
|
|
|
+ sum( photo_click ) AS photoClick ,
|
|
|
+ CONCAT( ROUND( sum( photo_click ) / sum( `show` ) * 100, 2 ), '%' ) AS clickRate,
|
|
|
+ CONCAT( ROUND( sum( bclick ) / sum( aclick ) * 100, 2 ), '%' ) AS bClickRate,
|
|
|
+ ROUND( sum( charge ) / sum( `show` ) * 1000, 2 ) AS cpm,
|
|
|
+ ROUND( sum( charge ) / sum( photo_click ) * 1000, 2 ) AS cpc,
|
|
|
+ ROUND( sum( charge ) / sum( bclick ) * 1000, 2 ) AS cpb,
|
|
|
+ sum( download_started ) AS downloadStart,
|
|
|
+ CONCAT( ROUND( sum( download_started ) / sum( bclick ) * 100, 2 ), '%' ) AS downloadStartRate,
|
|
|
+ ROUND( sum( charge ) / sum( download_started ) * 100, 2 ) AS downloadStartCost,
|
|
|
+
|
|
|
+ CONCAT(ROUND( sum( event_pay_first_day ) / sum( activation ) * 100, 2 ), '%' ) AS eventNewUserPayRatio,
|
|
|
+ sum( download_completed ) AS downloadFinish,
|
|
|
+ CONCAT( ROUND( sum( download_completed ) / sum( download_started ) * 100, 2 ), '%' ) AS downloadFinishRate,
|
|
|
+
|
|
|
+ ROUND( sum( charge ) / sum( download_completed ) * 100, 2 ) AS downloadFinishCost,
|
|
|
+ sum( activation ) AS active,
|
|
|
+ ROUND( sum( charge ) / sum( activation ) * 100, 2 ) AS activeCost,
|
|
|
+ CONCAT( ROUND( sum( activation ) / sum( download_completed ) * 100, 2 ), '%' ) AS activeRate,
|
|
|
+ sum( event_pay_first_day ) AS firstDayPay,
|
|
|
+ sum( event_pay_purchase_amount_first_day ) AS firstDayPayAmount,
|
|
|
+ ROUND( sum( charge ) / sum( event_pay_first_day ) * 100, 2 ) AS firstDayPayCost,
|
|
|
+ ROUND( sum( event_pay_purchase_amount_first_day ) / sum( charge ) * 100, 2 ) AS firstDayPayROI,
|
|
|
+ sum( event_pay ) AS eventPay,
|
|
|
+ sum( event_pay_purchase_amount ) AS eventPayPurchaseAmount,
|
|
|
+ ROUND( sum( charge ) / sum( event_pay ) * 100, 2 ) AS eventPayCost,
|
|
|
+ ROUND( sum( event_pay_purchase_amount ) / sum( charge ) * 100, 2 ) AS ROI,
|
|
|
+ sum( event_register ) AS register,
|
|
|
+ ROUND( sum( charge ) / sum( event_register ) * 100, 2 ) AS activeRegisterCost,
|
|
|
+ CONCAT( ROUND( sum( event_register ) / sum( activation ) * 100, 2 ), '%' ) AS activeRegisterRate,
|
|
|
+ sum( event_next_day_stay ) AS nextDayOpen,
|
|
|
+ ROUND( sum( charge ) / sum( event_next_day_stay ) * 100, 2 ) AS nextDayOpenCost,
|
|
|
+ CONCAT(ROUND( sum( charge ) / sum( form_count ) * 100, 2 ), '%' ) AS nextDayOpenRate,
|
|
|
+ sum( event_jin_jian_app ) AS eventJinJianApp,
|
|
|
+ ROUND( sum( charge ) / sum( event_jin_jian_app ) * 100, 2 ) AS eventJinJianAppCost,
|
|
|
+ sum( event_credit_grant_app ) AS eventCreditGrantApp,
|
|
|
+ ROUND( sum( charge ) / sum( event_credit_grant_app ) * 100, 2 ) AS eventCreditGrantAppCost,
|
|
|
+ CONCAT( ROUND( sum( event_credit_grant_app ) / sum( event_jin_jian_app ) * 100, 2 ), '%' ) AS eventCreditGrantAppRate,
|
|
|
+ ROUND( sum( charge ) / sum( aclick ) * 100, 2 ) AS play3sRate,
|
|
|
+ sum( key_action ) AS keyAction,
|
|
|
+ ROUND( sum( charge ) / sum( aclick ) * 100, 2 ) AS keyActionCost,
|
|
|
+ sum( event_app_invoked ) AS eventAppInvoked,
|
|
|
+ ROUND( sum( charge ) / sum( bclick ) * 100, 2 ) AS eventAppInvokedCost,
|
|
|
+ CONCAT( ROUND( sum( event_app_invoked ) / sum( bclick ) * 100, 2 ), '%' ) AS eventAppInvokedRatio,
|
|
|
+ sum( form_count ) AS formCount,
|
|
|
+ CONCAT( ROUND( sum( form_cost ) / sum( bclick ) * 100, 2 ), '%' ) AS formCountRate,
|
|
|
+ ROUND( sum( charge ) / sum( event_jin_jian_app ) * 100, 2 ) AS formCountCost,
|
|
|
+ sum( event_jin_jian_landing_page ) AS eventJinJianLandingPage,
|
|
|
+ ROUND( sum( charge ) / sum( event_jin_jian_landing_page ) * 100, 2 ) AS eventJinJianLandingPageCost,
|
|
|
+ sum( event_credit_grant_landing_page ) AS eventCreditGrantLandingPage,
|
|
|
+ ROUND( sum( charge ) / sum( event_credit_grant_landing_page_ratio ) * 100, 2 ) AS eventCreditGrantLandingPageCost,
|
|
|
+ CONCAT( ROUND( sum( event_credit_grant_landing_page ) / sum( event_jin_jian_landing_page ) * 100, 2 ), '%' ) AS eventCreditGrantLandingPageRate,
|
|
|
+ sum( event_button_click ) AS submit,
|
|
|
+ ROUND( sum( charge ) / sum( event_button_click ) * 100, 2 ) AS submitCost,
|
|
|
+ CONCAT( ROUND( sum( event_button_click ) / sum( bclick ) * 100, 2 ), '%' ) AS submitRate
|
|
|
FROM
|
|
|
- media_api.`kuaishou_unit_report_hourly`
|
|
|
+ application.kuaishou_unit_report_hourly_dw
|
|
|
WHERE
|
|
|
stat_date >= #{startTime}
|
|
|
AND stat_date <= #{endTime}
|
|
|
- AND advertiser_id = #{advertiserId}
|
|
|
- ORDER BY charge DESC
|
|
|
+ AND account_id = #{advertiserId}
|
|
|
+ GROUP BY unit_id
|
|
|
+ ORDER BY sum( charge ) DESC
|
|
|
LIMIT 10
|
|
|
</select>
|
|
|
|
|
@@ -60,52 +82,74 @@
|
|
|
<!-- 查询快手组 日报 消耗前10 -->
|
|
|
<select id="getKuaishouUnitReportDaily" resultType="org.jeecg.ctop.material.entity.KuaishouUnitReportHourlyPojo">
|
|
|
SELECT
|
|
|
- unit_id AS unitId,
|
|
|
- unit_name as unitName,
|
|
|
- aclick as aclick,
|
|
|
- bclick as bclick,
|
|
|
- charge as cost,
|
|
|
- `show` as photoShow,
|
|
|
- photo_click_ratio as clickRate,
|
|
|
- action_ratio as bClickRate,
|
|
|
- impression_1k_cost as cpm,
|
|
|
- photo_click_cost as cpc,
|
|
|
- action_cost as cpb,
|
|
|
- download_started as downloadStart,
|
|
|
- download_completed as downloadFinish,
|
|
|
- activation as active,
|
|
|
- event_pay_first_day as firstDayPay,
|
|
|
- event_pay_purchase_amount_first_day as firstDayPayAmount,
|
|
|
- event_pay_first_day_roi as firstDayPayROI,
|
|
|
- event_pay_roi as ROI,
|
|
|
- event_register as register,
|
|
|
- event_register_cost as activeRegisterCost,
|
|
|
- event_register_ratio as activeRegisterRate,
|
|
|
- event_next_day_stay as nextDayOpen,
|
|
|
- event_next_day_stay_cost as nextDayOpenCost,
|
|
|
- event_next_day_stay_ratio as nextDayOpenRate,
|
|
|
- event_credit_grant_landing_page_ratio as eventCreditGrantLandingPageRate,
|
|
|
- play_3s_ratio as play3sRate,
|
|
|
- form_cost as formCountCost,
|
|
|
- form_action_ratio as formCountRate,
|
|
|
- event_button_click_cost as submitCost,
|
|
|
- event_button_click_ratio as submitRate,
|
|
|
- charge as cost,
|
|
|
- `show` as photoShow,
|
|
|
- CONCAT(ROUND(download_started / bclick * 100,2) ,'%') as downloadStartRate,
|
|
|
- ROUND(download_started / bclick * 100,2) as downloadStartCost,
|
|
|
- CONCAT(ROUND(download_completed / download_started * 100,2) ,'%') as downloadFinishRate,
|
|
|
- ROUND(charge / download_completed * 100,2) as downloadFinishCost,
|
|
|
- ROUND(charge / activation * 100,2) as activeCost,
|
|
|
- CONCAT(ROUND(activation / download_completed * 100,2) ,'%') as activeRate,
|
|
|
- ROUND(charge / event_pay_first_day * 100,2) as firstDayPayCost
|
|
|
+ unit_id,
|
|
|
+ unit_name,
|
|
|
+ sum( aclick ) AS aClick,
|
|
|
+ sum( bclick ) AS bClick,
|
|
|
+ sum( charge ) AS cost,
|
|
|
+ sum( `show` ) AS photoShow,
|
|
|
+ sum( photo_click ) AS photoClick ,
|
|
|
+ CONCAT( ROUND( sum( photo_click ) / sum( `show` ) * 100, 2 ), '%' ) AS clickRate,
|
|
|
+ CONCAT( ROUND( sum( bclick ) / sum( aclick ) * 100, 2 ), '%' ) AS bClickRate,
|
|
|
+ ROUND( sum( charge ) / sum( `show` ) * 1000, 2 ) AS cpm,
|
|
|
+ ROUND( sum( charge ) / sum( photo_click ) * 1000, 2 ) AS cpc,
|
|
|
+ ROUND( sum( charge ) / sum( bclick ) * 1000, 2 ) AS cpb,
|
|
|
+ sum( download_started ) AS downloadStart,
|
|
|
+ CONCAT( ROUND( sum( download_started ) / sum( bclick ) * 100, 2 ), '%' ) AS downloadStartRate,
|
|
|
+ ROUND( sum( charge ) / sum( download_started ) * 100, 2 ) AS downloadStartCost,
|
|
|
+
|
|
|
+ CONCAT(ROUND( sum( event_pay_first_day ) / sum( activation ) * 100, 2 ), '%' ) AS eventNewUserPayRatio,
|
|
|
+ sum( download_completed ) AS downloadFinish,
|
|
|
+ CONCAT( ROUND( sum( download_completed ) / sum( download_started ) * 100, 2 ), '%' ) AS downloadFinishRate,
|
|
|
+
|
|
|
+ ROUND( sum( charge ) / sum( download_completed ) * 100, 2 ) AS downloadFinishCost,
|
|
|
+ sum( activation ) AS active,
|
|
|
+ ROUND( sum( charge ) / sum( activation ) * 100, 2 ) AS activeCost,
|
|
|
+ CONCAT( ROUND( sum( activation ) / sum( download_completed ) * 100, 2 ), '%' ) AS activeRate,
|
|
|
+ sum( event_pay_first_day ) AS firstDayPay,
|
|
|
+ sum( event_pay_purchase_amount_first_day ) AS firstDayPayAmount,
|
|
|
+ ROUND( sum( charge ) / sum( event_pay_first_day ) * 100, 2 ) AS firstDayPayCost,
|
|
|
+ ROUND( sum( event_pay_purchase_amount_first_day ) / sum( charge ) * 100, 2 ) AS firstDayPayROI,
|
|
|
+ sum( event_pay ) AS eventPay,
|
|
|
+ sum( event_pay_purchase_amount ) AS eventPayPurchaseAmount,
|
|
|
+ ROUND( sum( charge ) / sum( event_pay ) * 100, 2 ) AS eventPayCost,
|
|
|
+ ROUND( sum( event_pay_purchase_amount ) / sum( charge ) * 100, 2 ) AS ROI,
|
|
|
+ sum( event_register ) AS register,
|
|
|
+ ROUND( sum( charge ) / sum( event_register ) * 100, 2 ) AS activeRegisterCost,
|
|
|
+ CONCAT( ROUND( sum( event_register ) / sum( activation ) * 100, 2 ), '%' ) AS activeRegisterRate,
|
|
|
+ sum( event_next_day_stay ) AS nextDayOpen,
|
|
|
+ ROUND( sum( charge ) / sum( event_next_day_stay ) * 100, 2 ) AS nextDayOpenCost,
|
|
|
+ CONCAT(ROUND( sum( charge ) / sum( form_count ) * 100, 2 ), '%' ) AS nextDayOpenRate,
|
|
|
+ sum( event_jin_jian_app ) AS eventJinJianApp,
|
|
|
+ ROUND( sum( charge ) / sum( event_jin_jian_app ) * 100, 2 ) AS eventJinJianAppCost,
|
|
|
+ sum( event_credit_grant_app ) AS eventCreditGrantApp,
|
|
|
+ ROUND( sum( charge ) / sum( event_credit_grant_app ) * 100, 2 ) AS eventCreditGrantAppCost,
|
|
|
+ CONCAT( ROUND( sum( event_credit_grant_app ) / sum( event_jin_jian_app ) * 100, 2 ), '%' ) AS eventCreditGrantAppRate,
|
|
|
+ ROUND( sum( charge ) / sum( aclick ) * 100, 2 ) AS play3sRate,
|
|
|
+ sum( key_action ) AS keyAction,
|
|
|
+ ROUND( sum( charge ) / sum( aclick ) * 100, 2 ) AS keyActionCost,
|
|
|
+ sum( event_app_invoked ) AS eventAppInvoked,
|
|
|
+ ROUND( sum( charge ) / sum( bclick ) * 100, 2 ) AS eventAppInvokedCost,
|
|
|
+ CONCAT( ROUND( sum( event_app_invoked ) / sum( bclick ) * 100, 2 ), '%' ) AS eventAppInvokedRatio,
|
|
|
+ sum( form_count ) AS formCount,
|
|
|
+ CONCAT( ROUND( sum( form_cost ) / sum( bclick ) * 100, 2 ), '%' ) AS formCountRate,
|
|
|
+ ROUND( sum( charge ) / sum( event_jin_jian_app ) * 100, 2 ) AS formCountCost,
|
|
|
+ sum( event_jin_jian_landing_page ) AS eventJinJianLandingPage,
|
|
|
+ ROUND( sum( charge ) / sum( event_jin_jian_landing_page ) * 100, 2 ) AS eventJinJianLandingPageCost,
|
|
|
+ sum( event_credit_grant_landing_page ) AS eventCreditGrantLandingPage,
|
|
|
+ ROUND( sum( charge ) / sum( event_credit_grant_landing_page_ratio ) * 100, 2 ) AS eventCreditGrantLandingPageCost,
|
|
|
+ CONCAT( ROUND( sum( event_credit_grant_landing_page ) / sum( event_jin_jian_landing_page ) * 100, 2 ), '%' ) AS eventCreditGrantLandingPageRate,
|
|
|
+ sum( event_button_click ) AS submit,
|
|
|
+ ROUND( sum( charge ) / sum( event_button_click ) * 100, 2 ) AS submitCost,
|
|
|
+ CONCAT( ROUND( sum( event_button_click ) / sum( bclick ) * 100, 2 ), '%' ) AS submitRate
|
|
|
FROM
|
|
|
- media_api.`kuaishou_unit_report_daily`
|
|
|
+ application.kuaishou_unit_report_daily_dw
|
|
|
WHERE
|
|
|
stat_date >= #{startTime}
|
|
|
AND stat_date <= #{endTime}
|
|
|
- AND advertiser_id = #{advertiserId}
|
|
|
- ORDER BY charge DESC
|
|
|
+ AND account_id = #{advertiserId}
|
|
|
+ GROUP BY unit_id
|
|
|
+ ORDER BY sum( charge ) DESC
|
|
|
LIMIT 10
|
|
|
</select>
|
|
|
|