|
@@ -41,6 +41,8 @@
|
|
|
sum(bclick) bClick,-- 行为数
|
|
|
sum(form_count) formCount,
|
|
|
(sum(charge) / sum(form_count)) formPrice, -- 表单提交单价
|
|
|
+ sum(activation) activationCount, -- 激活数
|
|
|
+ (sum(charge) / sum(activation)) activationPrice, -- 激活单价
|
|
|
account_id accountId,
|
|
|
(select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName
|
|
|
from
|
|
@@ -66,6 +68,8 @@
|
|
|
sum(bclick) bClick,-- 行为数
|
|
|
sum(form_count) formCount,
|
|
|
(sum(charge) / sum(form_count)) formPrice, -- 表单提交单价
|
|
|
+ sum(activation) activationCount, -- 激活数
|
|
|
+ (sum(charge) / sum(activation)) activationPrice, -- 激活单价
|
|
|
account_id accountId,
|
|
|
(select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName
|
|
|
from
|
|
@@ -250,26 +254,41 @@
|
|
|
|
|
|
<select id="selectAllByAccounts" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
select
|
|
|
- sum(charge) cost, -- 消耗
|
|
|
- sum(photo_show) photoShow, -- 封面展示
|
|
|
- sum(photo_click) photoClick, -- 封面点击
|
|
|
- sum(aclick) aclick, -- 素材曝光数
|
|
|
- (sum(photo_click) / sum(photo_show)) photoClickRatio, -- 封面点击率
|
|
|
- (sum(form_count) / sum(bclick)) cvr,
|
|
|
- ((sum(charge) / (sum(photo_show)) * 1000)) cpm,
|
|
|
- sum(bclick) bClick,-- 行为数
|
|
|
- sum(form_count) formCount,
|
|
|
- (sum(charge) / sum(form_count)) formPrice, -- 表单提交单价
|
|
|
- account_id accountId,
|
|
|
- (select auth_name from ctop_user_allocation where account_id = accountId limit 1) accountName
|
|
|
+ sum(charge) cost,
|
|
|
+ sum(photo_show) photoShow,
|
|
|
+ sum(photo_click) photoClick,
|
|
|
+ sum(aclick) aclick,
|
|
|
+ DATE_FORMAT(stat_date,'%Y-%m') statDate
|
|
|
from
|
|
|
- ctop_kuaishou_report_hourly_account
|
|
|
+ ctop_kuaishou_report_daily_account
|
|
|
where account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
- group by account_id
|
|
|
+ group by DATE_FORMAT(stat_date,'%Y-%m')
|
|
|
+ order by stat_date asc
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectDayDetailByMonth" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
+ select
|
|
|
+ sum(charge) cost,
|
|
|
+ sum(photo_show) photoShow,
|
|
|
+ sum(photo_click) photoClick,
|
|
|
+ sum(aclick) aclick,
|
|
|
+ DATE_FORMAT(stat_date,'%Y-%m') statDate
|
|
|
+ from
|
|
|
+ ctop_kuaishou_report_daily_account
|
|
|
+ where stat_date <= #{startDate}
|
|
|
+ and stat_date >= #{endDate}
|
|
|
+ and account_id in
|
|
|
+ <foreach item="item" index="index" collection="accountIds"
|
|
|
+ open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ group by DATE_FORMAT(stat_date,'%Y-%m')
|
|
|
+ order by stat_date asc
|
|
|
</select>
|
|
|
|
|
|
|