|
@@ -11,7 +11,7 @@
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
(sum(photo_click) / sum(photo_show)) photoClickRatio, -- 封面点击率
|
|
(sum(photo_click) / sum(photo_show)) photoClickRatio, -- 封面点击率
|
|
(sum(form_count) / sum(bclick)) cvr,
|
|
(sum(form_count) / sum(bclick)) cvr,
|
|
- (sum(charge) / (sum(photo_show) * 1000)) cpm,
|
|
|
|
|
|
+ ((sum(charge) / (sum(photo_show)) * 1000)) cpm,
|
|
sum(bclick) bClick,-- 行为数
|
|
sum(bclick) bClick,-- 行为数
|
|
sum(form_count) formCount, -- 表单提交数
|
|
sum(form_count) formCount, -- 表单提交数
|
|
(sum(charge) / sum(form_count)) formPrice -- 表单提交单价
|
|
(sum(charge) / sum(form_count)) formPrice -- 表单提交单价
|
|
@@ -29,86 +29,80 @@
|
|
|
|
|
|
<select id="selectAccountReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="selectAccountReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
select
|
|
select
|
|
- sum(t1.charge) cost, -- 消耗
|
|
|
|
- sum(t1.photo_show) photoShow, -- 封面展示
|
|
|
|
- sum(t1.photo_click) photoClick, -- 封面点击
|
|
|
|
|
|
+ sum(charge) cost, -- 消耗
|
|
|
|
+ sum(photo_show) photoShow, -- 封面展示
|
|
|
|
+ sum(photo_click) photoClick, -- 封面点击
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
- (sum(t1.photo_click) / sum(t1.photo_show)) photoClickRatio, -- 封面点击率
|
|
|
|
- (sum(t1.form_count) / sum(t1.bclick)) cvr,
|
|
|
|
- (sum(t1.charge) / (sum(t1.photo_show) * 1000)) cpm,
|
|
|
|
- sum(t1.bclick) bClick,-- 行为数
|
|
|
|
- sum(t1.form_count) formCount,
|
|
|
|
- (sum(t1.charge) / sum(t1.form_count)) formPrice, -- 表单提交单价
|
|
|
|
- t1.account_id accountId,
|
|
|
|
- t2.auth_name accountName
|
|
|
|
|
|
+ (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
|
|
|
|
+
|
|
from
|
|
from
|
|
- ctop_kuaishou_report_daily_account t1
|
|
|
|
- LEFT JOIN ctop_user_allocation t2
|
|
|
|
- ON t1.account_id = t2.account_id
|
|
|
|
- where t1.account_id in
|
|
|
|
|
|
+ ctop_kuaishou_report_daily_account
|
|
|
|
+ where account_id in
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- group by t1.account_id;
|
|
|
|
|
|
+ group by account_id;
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectAccountReportByDate" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="selectAccountReportByDate" resultType="com.alibaba.fastjson.JSONObject">
|
|
select
|
|
select
|
|
- sum(t1.charge) cost, -- 消耗
|
|
|
|
- sum(t1.photo_show) photoShow, -- 封面展示
|
|
|
|
- sum(t1.photo_click) photoClick, -- 封面点击
|
|
|
|
|
|
+ sum(charge) cost, -- 消耗
|
|
|
|
+ sum(photo_show) photoShow, -- 封面展示
|
|
|
|
+ sum(photo_click) photoClick, -- 封面点击
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
- (sum(t1.photo_click) / sum(t1.photo_show)) photoClickRatio, -- 封面点击率
|
|
|
|
- (sum(t1.form_count) / sum(t1.bclick)) cvr,
|
|
|
|
- (sum(t1.charge) / (sum(t1.photo_show) * 1000)) cpm,
|
|
|
|
- sum(t1.bclick) bClick,-- 行为数
|
|
|
|
- sum(t1.form_count) formCount,
|
|
|
|
- (sum(t1.charge) / sum(t1.form_count)) formPrice, -- 表单提交单价
|
|
|
|
- t1.account_id accountId,
|
|
|
|
- t2.auth_name accountName
|
|
|
|
|
|
+ (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
|
|
from
|
|
from
|
|
- ctop_kuaishou_report_daily_account t1
|
|
|
|
- LEFT JOIN ctop_user_allocation t2
|
|
|
|
- ON t1.account_id = t2.account_id
|
|
|
|
- where t1.stat_date <= #{startDate}
|
|
|
|
- and t1.stat_date >= #{endDate}
|
|
|
|
- and t1.account_id in
|
|
|
|
|
|
+ ctop_kuaishou_report_daily_account
|
|
|
|
+
|
|
|
|
+ where stat_date <= #{startDate}
|
|
|
|
+ and stat_date >= #{endDate}
|
|
|
|
+ and account_id in
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- group by t1.account_id;
|
|
|
|
|
|
+ group by account_id;
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectReportDetailGroupAccountId" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="selectReportDetailGroupAccountId" resultType="com.alibaba.fastjson.JSONObject">
|
|
select
|
|
select
|
|
- sum(t1.charge) cost, -- 消耗
|
|
|
|
- sum(t1.photo_show) photoShow, -- 封面展示
|
|
|
|
- sum(t1.photo_click) photoClick, -- 封面点击
|
|
|
|
|
|
+ sum(charge) cost, -- 消耗
|
|
|
|
+ sum(photo_show) photoShow, -- 封面展示
|
|
|
|
+ sum(photo_click) photoClick, -- 封面点击
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
- (sum(t1.photo_click) / sum(t1.photo_show)) photoClickRatio, -- 封面点击率
|
|
|
|
- (sum(t1.form_count) / sum(t1.bclick)) cvr,
|
|
|
|
- (sum(t1.charge) / (sum(t1.photo_show) * 1000)) cpm,
|
|
|
|
- sum(t1.bclick) bClick,-- 行为数
|
|
|
|
- sum(t1.form_count) formCount,
|
|
|
|
- (sum(t1.charge) / sum(t1.form_count)) formPrice, -- 表单提交单价
|
|
|
|
- t1.account_id accountId,
|
|
|
|
- t2.auth_name accountName
|
|
|
|
|
|
+ (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
|
|
|
|
+
|
|
from
|
|
from
|
|
- ctop_kuaishou_report_hourly_account t1
|
|
|
|
- LEFT JOIN ctop_user_allocation t2
|
|
|
|
- ON t1.account_id = t2.account_id
|
|
|
|
- where t1.stat_date = #{date}
|
|
|
|
- and t1.account_id in
|
|
|
|
|
|
+ ctop_kuaishou_report_hourly_account
|
|
|
|
+ where stat_date = #{date}
|
|
|
|
+ and stat_hour <= #{statHour}
|
|
|
|
+ and account_id in
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- and stat_hour <= #{statHour}
|
|
|
|
- group by t1.account_id;
|
|
|
|
|
|
+ group by account_id;
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
@@ -252,30 +246,25 @@
|
|
|
|
|
|
<select id="selectAllByAccounts" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="selectAllByAccounts" resultType="com.alibaba.fastjson.JSONObject">
|
|
select
|
|
select
|
|
- sum(t1.charge) cost, -- 消耗
|
|
|
|
- sum(t1.photo_show) photoShow, -- 封面展示
|
|
|
|
- sum(t1.photo_click) photoClick, -- 封面点击
|
|
|
|
|
|
+ sum(charge) cost, -- 消耗
|
|
|
|
+ sum(photo_show) photoShow, -- 封面展示
|
|
|
|
+ sum(photo_click) photoClick, -- 封面点击
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
sum(aclick) aclick, -- 素材曝光数
|
|
- (sum(t1.photo_click) / sum(t1.photo_show)) photoClickRatio, -- 封面点击率
|
|
|
|
- (sum(t1.form_count) / sum(t1.bclick)) cvr,
|
|
|
|
- (sum(t1.charge) / (sum(t1.photo_show) * 1000)) cpm,
|
|
|
|
- sum(t1.bclick) bClick,-- 行为数
|
|
|
|
- sum(t1.form_count) formCount,
|
|
|
|
- (sum(t1.charge) / sum(t1.form_count)) formPrice, -- 表单提交单价
|
|
|
|
- t1.account_id accountId,
|
|
|
|
- t2.auth_name accountName
|
|
|
|
|
|
+ (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
|
|
from
|
|
from
|
|
- ctop_kuaishou_report_hourly_account t1
|
|
|
|
- LEFT JOIN ctop_user_allocation t2
|
|
|
|
- ON t1.account_id = t2.account_id
|
|
|
|
- where t1.account_id in
|
|
|
|
|
|
+ ctop_kuaishou_report_hourly_account
|
|
|
|
+ where account_id in
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- group by t1.account_id;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ group by account_id
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|