|
@@ -131,8 +131,7 @@
|
|
|
sum(report.event_pay) AS 'eventPay',
|
|
|
sum(report.form_count) AS 'formCount',
|
|
|
sum(report.event_jin_jian_app) AS 'eventJinJianApp',
|
|
|
- sum(report.event_credit_grant_app) AS 'eventCreditGrantApp',
|
|
|
- report.realname as 'userName'
|
|
|
+ sum(report.event_credit_grant_app) AS 'eventCreditGrantApp'
|
|
|
from ctop_kuaishou_report_daily_image report
|
|
|
left join ctop_user_allocation allocation on allocation.account_id = report.account_id
|
|
|
left join ctop_project p on p.id = allocation.project_id
|
|
@@ -158,6 +157,56 @@
|
|
|
group by report.cover_id)a
|
|
|
order by a.${target} ${order}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="imageCostTotal" resultType="cn.com.ctop.common.module.vo.KuaishouImageCostVO">
|
|
|
+ select
|
|
|
+ sum(report.charge) AS 'cost',
|
|
|
+ sum(report.photo_click) AS 'photoClick',
|
|
|
+ (case when sum(report.photo_show)!=0 and sum(report.photo_click)!=0
|
|
|
+ then round(sum(photo_click)/sum(photo_show)*100,2)
|
|
|
+ else 0 end)as 'photoClickRate',
|
|
|
+ sum(report.photo_show) AS 'photoShow',
|
|
|
+ (case when sum(report.charge)!=0 and sum(report.photo_show)!=0
|
|
|
+ then round(sum(charge)/sum(photo_show)*1000,2)
|
|
|
+ else 0 end)as 'photoShowCost',
|
|
|
+ sum(report.aclick) as 'aclick',
|
|
|
+ sum(report.bclick) as 'bclick',
|
|
|
+ (case when sum(report.bclick)!=0 and sum(report.aclick)!=0
|
|
|
+ then round(sum(bclick)/sum(aclick)*100,2)
|
|
|
+ else 0 end)as 'bclickRate',
|
|
|
+ (case when sum(report.charge)!=0 and sum(report.aclick)!=0
|
|
|
+ then round(sum(charge)/sum(aclick)*1000,2)
|
|
|
+ else 0 end)as 'aclickCost',
|
|
|
+ sum(report.activation) AS 'activation',
|
|
|
+ sum(report.event_register) AS 'eventRegister',
|
|
|
+ sum(report.event_pay) AS 'eventPay',
|
|
|
+ sum(report.form_count) AS 'formCount',
|
|
|
+ sum(report.event_jin_jian_app) AS 'eventJinJianApp',
|
|
|
+ sum(report.event_credit_grant_app) AS 'eventCreditGrantApp'
|
|
|
+ from ctop_kuaishou_report_daily_image report
|
|
|
+ left join ctop_user_allocation allocation on allocation.account_id = report.account_id
|
|
|
+ left join ctop_project p on p.id = allocation.project_id
|
|
|
+ where
|
|
|
+ 1=1
|
|
|
+ and
|
|
|
+ report.cover_id is not null
|
|
|
+ <if test="startDate!=null">
|
|
|
+ and report.stat_date >= #{startDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate!=null">
|
|
|
+ and report.stat_date <= #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="accountList!=null">
|
|
|
+ and report.account_id in
|
|
|
+ <foreach item="accountId" collection="accountList" open="(" separator="," close=")">
|
|
|
+ #{accountId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="code!=null">
|
|
|
+ and report.cover_id = #{code}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="imageCostEntity" resultType="cn.com.ctop.common.module.vo.KuaishouImageCostVOEntity">
|
|
|
select * from (select
|
|
|
report.cover_url as 'imageUrl' ,
|