|
@@ -81,7 +81,7 @@
|
|
<select id="getOnedayAggregatebyDaily"
|
|
<select id="getOnedayAggregatebyDaily"
|
|
resultType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly">
|
|
resultType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly">
|
|
SELECT stat_date,
|
|
SELECT stat_date,
|
|
- IFNULL(SUM(charge),0) as 'charge',
|
|
|
|
|
|
+ IFNULL(SUM(charge), 0) as 'charge',
|
|
SUM(photo_show) as 'photoShow',
|
|
SUM(photo_show) as 'photoShow',
|
|
SUM(photo_click) as 'photoClick',
|
|
SUM(photo_click) as 'photoClick',
|
|
SUM(aclick) as 'aclick',
|
|
SUM(aclick) as 'aclick',
|
|
@@ -149,75 +149,113 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
- <select id="getOnedayEtlReportList"
|
|
|
|
- resultType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly">
|
|
|
|
- SELECT stat_date,
|
|
|
|
- IFNULL(SUM(charge),0) as 'charge',
|
|
|
|
- SUM(photo_show) as 'photoShow',
|
|
|
|
- SUM(photo_click) as 'photoClick',
|
|
|
|
- SUM(aclick) as 'aclick',
|
|
|
|
- SUM(bclick) as 'bclick',
|
|
|
|
- SUM(photo_share) as 'photoShare',
|
|
|
|
- SUM(photo_comment) as 'photoComment',
|
|
|
|
- SUM(photo_like) as 'photoLike',
|
|
|
|
- SUM(follow) as 'follow',
|
|
|
|
- SUM(cancel_follow) as 'cancelFollow',
|
|
|
|
- SUM(report) as 'report',
|
|
|
|
- SUM(block) as 'block',
|
|
|
|
- SUM(negative) as 'negative',
|
|
|
|
- SUM(download_started) as 'downloadStarted',
|
|
|
|
- SUM(download_completed) as 'downloadCompleted',
|
|
|
|
- SUM(activation) as 'activation',
|
|
|
|
- SUM(submit) as 'submit',
|
|
|
|
- SUM(event_pay_first_day) as 'eventPayFirstDay',
|
|
|
|
- SUM(event_pay_purchase_amount_first_day) as 'eventPayPurchaseAmountFirstDay',
|
|
|
|
- SUM(event_pay) as 'eventPay',
|
|
|
|
- SUM(event_pay_purchase_amount) as 'eventPayPurchaseAmount',
|
|
|
|
- SUM(event_register) as 'eventRegister',
|
|
|
|
- SUM(event_jin_jian_app) as 'eventJinJianApp',
|
|
|
|
- SUM(event_credit_grant_app) as 'eventCreditGrantApp',
|
|
|
|
- SUM(event_order_paid) as 'eventOrderPaid',
|
|
|
|
- SUM(event_order_paid_purchase_amount) as 'eventOrderPaidPurchaseAmount',
|
|
|
|
- SUM(event_jin_jian_landing_page) as 'eventJinJianLandingPage',
|
|
|
|
- SUM(event_credit_grant_landing_page) as 'eventCreditGrantLandingPage',
|
|
|
|
- SUM(event_next_day_stay) as 'eventNextDayStay',
|
|
|
|
- SUM(form_count) as 'formCount',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(activation), 2), 0) as 'activationCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(activation) * 1000, 2), 0) as 'impression1kCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(photo_click), 2), 0) as 'photoClickCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(bclick), 2), 0) as 'actionCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(download_started), 2), 0) as 'downloadStartedCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(download_completed), 2), 0) as 'downloadCompletedCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(form_count), 2), 0) as 'formCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(event_pay_first_day), 2), 0) as 'eventPayFirstDayCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(event_pay), 2), 0) as 'eventPayCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(event_register), 2), 0) as 'eventRegisterCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(event_next_day_stay), 2), 0) as 'eventNextDayStayCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(event_jin_jian_app), 2), 0) as 'eventJinJianAppCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(event_credit_grant_app), 2), 0) as 'eventCreditGrantAppCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(event_jin_jian_landing_page), 2), 0) as 'eventJinJianLandingPageCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(event_credit_grant_landing_page), 2),
|
|
|
|
- 0) as 'eventCreditGrantLandingPageCost',
|
|
|
|
- IFNULL(ROUND(SUM(charge) / SUM(submit), 2), 0) as 'submitCost',
|
|
|
|
- IFNULL(ROUND(SUM(event_pay_purchase_amount_first_day) / SUM(charge) * 100, 2),
|
|
|
|
- 0) as 'eventPayFirstDayRoi',
|
|
|
|
- IFNULL(ROUND(SUM(event_pay_purchase_amount) / SUM(charge) * 100, 2), 0) as 'eventPayRoi',
|
|
|
|
- IFNULL(ROUND(SUM(bclick) / SUM(activation) * 100, 2), 0) as 'actionRatio',
|
|
|
|
- IFNULL(ROUND(SUM(photo_click) / SUM(photo_show) * 100, 2), 0) as 'photoClickRatio',
|
|
|
|
- IFNULL(ROUND(SUM(download_started) / SUM(bclick) * 100, 2), 0) as 'downloadStartedRatio',
|
|
|
|
- IFNULL(ROUND(SUM(download_completed) / SUM(download_started) * 100, 2), 0) as 'downloadCompletedRatio',
|
|
|
|
- IFNULL(ROUND(SUM(activation) / SUM(download_completed) * 100, 2), 0) as 'activationRatio',
|
|
|
|
- IFNULL(ROUND(SUM(event_register) / SUM(activation) * 100, 2), 0) as 'eventRegisterRatio',
|
|
|
|
- IFNULL(ROUND(SUM(event_next_day_stay) / SUM(activation) * 100, 2), 0) as 'eventNextDayStayRatio',
|
|
|
|
- IFNULL(ROUND(SUM(event_credit_grant_app) / SUM(event_jin_jian_app) * 100, 2),
|
|
|
|
- 0) as 'eventCreditGrantAppRatio',
|
|
|
|
- IFNULL(ROUND(SUM(form_count) / SUM(bclick) * 100, 2), 0) as 'formActionRatio',
|
|
|
|
- IFNULL(ROUND(SUM(submit) / SUM(bclick) * 100, 2), 0) as 'submitRatio'
|
|
|
|
|
|
+ <select id="getOnedayEtlReportList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
+ SELECT
|
|
|
|
+ <if test="type == 'alone'">
|
|
|
|
+ ${value} as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type == 'more'">
|
|
|
|
+ <if test="value == 'activationCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(activation), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'impression1kCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(aclick) * 1000, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'photoClickCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(photo_click), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'actionCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(bclick), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'play3sRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(play_3s_count) / SUM(photo_show) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'downloadStartedCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(download_started), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'downloadCompletedCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(download_completed), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'formCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(form_count), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventPayFirstDayCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(event_pay_first_day), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventPayCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(event_pay), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventRegisterCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(event_register), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventNextDayStayCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(event_next_day_stay), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventJinJianAppCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(event_jin_jian_app), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventCreditGrantAppCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(event_credit_grant_app), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventJinJianLandingPageCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(event_jin_jian_landing_page), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventCreditGrantLandingPageCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(event_credit_grant_landing_page), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'submitCost'">
|
|
|
|
+ IFNULL(ROUND(SUM(charge) / SUM(submit), 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventPayFirstDayRoi'">
|
|
|
|
+ IFNULL(ROUND(SUM(event_pay_purchase_amount_first_day) / SUM(charge) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventPayRoi'">
|
|
|
|
+ IFNULL(ROUND(SUM(event_pay_purchase_amount) / SUM(charge) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'actionRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(bclick) / SUM(aclick) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'photoClickRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(photo_click) / SUM(photo_show) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'downloadStartedRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(download_started) / SUM(bclick) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'downloadCompletedRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(download_completed) / SUM(download_started) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'activationRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(activation) / SUM(download_completed) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventRegisterRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(event_register) / SUM(activation) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventNextDayStayRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(event_next_day_stay) / SUM(activation) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'eventCreditGrantAppRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(event_credit_grant_app) / SUM(event_jin_jian_app) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'formActionRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(form_count) / SUM(bclick) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ <if test="value == 'submitRatio'">
|
|
|
|
+ IFNULL(ROUND(SUM(submit) / SUM(bclick) * 100, 2), 0) as 'value',
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ stat_date
|
|
FROM ctop_etl_kuaishou_report_account_daily
|
|
FROM ctop_etl_kuaishou_report_account_daily
|
|
WHERE account_id = #{accountId}
|
|
WHERE account_id = #{accountId}
|
|
- AND stat_date >= #{startTime}
|
|
|
|
- AND stat_date <= #{endTime}
|
|
|
|
|
|
+ AND stat_date >= #{startTime}
|
|
|
|
+ AND stat_date <= #{endTime}
|
|
group by stat_date
|
|
group by stat_date
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="getMaxChargeAccountId" resultType="java.lang.Long">
|
|
|
|
+ select account_id
|
|
|
|
+ from ctop_etl_kuaishou_report_account_hourly
|
|
|
|
+ where stat_date = DATE_FORMAT(now(), '%Y-%m-%d')
|
|
|
|
+ order by charge desc limit 1
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|