|
@@ -3,24 +3,24 @@
|
|
|
<mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaiShouYiCheReportMapper">
|
|
|
|
|
|
<select id="getMaxHourByProjectIdAndStatDate" resultType="java.lang.Integer">
|
|
|
- SELECT
|
|
|
- max(t2.hour)
|
|
|
- FROM
|
|
|
- ctop_user_allocation t1
|
|
|
- LEFT JOIN application.kuaishou_account_report_hourly_dw t2 ON t1.account_id = t2.account_id
|
|
|
- WHERE
|
|
|
- t1.project_id = #{projectId}
|
|
|
- AND t2.stat_date = #{statDate}
|
|
|
+ SELECT
|
|
|
+ max(t2.stat_hour)
|
|
|
+ FROM
|
|
|
+ ctop_user_allocation t1
|
|
|
+ LEFT JOIN ctop_kuaishou_report_hourly_account t2 ON t1.account_id = t2.account_id
|
|
|
+ WHERE
|
|
|
+ t1.project_id = #{projectId}
|
|
|
+ AND t2.stat_date = #{statDate}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectReportByMap" parameterType="java.util.Map" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT
|
|
|
(case when t1.system_type = 'android'
|
|
|
- then '安卓'
|
|
|
- when t1.system_type = 'ios'
|
|
|
- then 'ios'
|
|
|
- else '-'
|
|
|
- end
|
|
|
+ then '安卓'
|
|
|
+ when t1.system_type = 'ios'
|
|
|
+ then 'ios'
|
|
|
+ else '-'
|
|
|
+ end
|
|
|
) as systemType,
|
|
|
t1.auth_name authName,
|
|
|
ROUND(sum(t2.charge) / #{disCount},3) charge,
|
|
@@ -47,7 +47,7 @@
|
|
|
|
|
|
FROM
|
|
|
ctop_user_allocation t1
|
|
|
- LEFT JOIN application.kuaishou_account_report_hourly_dw t2 ON t1.account_id = t2.account_id
|
|
|
+ LEFT JOIN ctop_kuaishou_report_hourly_account t2 ON t1.account_id = t2.account_id
|
|
|
where 1 = 1
|
|
|
<if test="projectId != null">
|
|
|
and t1.project_id = #{projectId}
|
|
@@ -58,7 +58,7 @@
|
|
|
</if>
|
|
|
|
|
|
<if test="statHour != null">
|
|
|
- and t2.hour <= #{statHour}
|
|
|
+ and t2.stat_hour <= #{statHour}
|
|
|
</if>
|
|
|
<if test="systemType != null">
|
|
|
and t1.system_type = #{systemType}
|
|
@@ -101,7 +101,7 @@
|
|
|
) estimatedCost
|
|
|
FROM
|
|
|
ctop_user_allocation t1
|
|
|
- LEFT JOIN application.kuaishou_account_report_hourly_dw t2 ON t1.account_id = t2.account_id
|
|
|
+ LEFT JOIN ctop_kuaishou_report_hourly_account t2 ON t1.account_id = t2.account_id
|
|
|
where 1 = 1
|
|
|
<if test="projectId != null">
|
|
|
and t1.project_id = #{projectId}
|
|
@@ -112,7 +112,7 @@
|
|
|
</if>
|
|
|
|
|
|
<if test="statHour != null">
|
|
|
- and t2.hour <= #{statHour}
|
|
|
+ and t2.stat_hour <= #{statHour}
|
|
|
</if>
|
|
|
<if test="systemType != null">
|
|
|
and t1.system_type = #{systemType}
|
|
@@ -143,15 +143,15 @@
|
|
|
DATE_FORMAT(t2.stat_date,'%Y/%c/%d') statDate,
|
|
|
sum(t2.charge) charge,
|
|
|
ROUND(sum(t2.charge) / #{disCount}, 3) cashCost,
|
|
|
- sum(t2.aclick + t2.show) photoShow,
|
|
|
+ sum(t2.aclick + t2.photo_show) photoShow,
|
|
|
sum(t2.photo_click + t2.bclick) photoClick,
|
|
|
(
|
|
|
CASE
|
|
|
- WHEN sum(t2.show) != 0 THEN
|
|
|
+ WHEN sum(t2.photo_show) != 0 THEN
|
|
|
CONCAT(
|
|
|
CAST(ROUND(
|
|
|
(
|
|
|
- sum(t2.photo_click + t2.bclick) / sum(t2.show + t2.aclick)
|
|
|
+ sum(t2.photo_click + t2.bclick) / sum(t2.photo_show + t2.aclick)
|
|
|
) * 100,
|
|
|
3
|
|
|
) AS CHAR)
|
|
@@ -164,10 +164,10 @@
|
|
|
) clickRate,
|
|
|
(
|
|
|
CASE
|
|
|
- WHEN sum(t2.show) != 0 THEN
|
|
|
+ WHEN sum(t2.photo_show) != 0 THEN
|
|
|
ROUND(
|
|
|
(
|
|
|
- sum(t2.charge) / sum(t2.show)
|
|
|
+ sum(t2.charge) / sum(t2.photo_show)
|
|
|
) * 1000,
|
|
|
3
|
|
|
)
|
|
@@ -270,7 +270,7 @@
|
|
|
) activationRatio
|
|
|
FROM
|
|
|
ctop_user_allocation t1
|
|
|
- LEFT JOIN application.kuaishou_account_report_daily_dw t2 ON t1.account_id = t2.account_id
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_account t2 ON t1.account_id = t2.account_id
|
|
|
where 1 = 1
|
|
|
<if test="projectId != null">
|
|
|
and t1.project_id = #{projectId}
|
|
@@ -309,15 +309,15 @@
|
|
|
DATE_FORMAT(t2.stat_date,'%Y/%c/%d') statDate,
|
|
|
sum(t2.charge) charge,
|
|
|
ROUND(sum(t2.charge) / #{disCount}, 3) cashCost,
|
|
|
- sum(t2.aclick + t2.show) photoShow,
|
|
|
+ sum(t2.aclick + t2.photo_show) photoShow,
|
|
|
sum(t2.photo_click + t2.bclick) photoClick,
|
|
|
(
|
|
|
CASE
|
|
|
- WHEN sum(t2.show) != 0 THEN
|
|
|
+ WHEN sum(t2.photo_show) != 0 THEN
|
|
|
CONCAT(
|
|
|
CAST( ROUND(
|
|
|
(
|
|
|
- sum(t2.photo_click + t2.bclick) / sum(t2.show + t2.aclick)
|
|
|
+ sum(t2.photo_click + t2.bclick) / sum(t2.photo_show + t2.aclick)
|
|
|
) * 100,
|
|
|
3
|
|
|
) AS CHAR)
|
|
@@ -330,10 +330,10 @@
|
|
|
) clickRate,
|
|
|
(
|
|
|
CASE
|
|
|
- WHEN sum(t2.show) != 0 THEN
|
|
|
+ WHEN sum(t2.photo_show) != 0 THEN
|
|
|
ROUND(
|
|
|
(
|
|
|
- sum(t2.charge) / sum(t2.show)
|
|
|
+ sum(t2.charge) / sum(t2.photo_show)
|
|
|
) * 1000,
|
|
|
3
|
|
|
)
|
|
@@ -464,7 +464,7 @@
|
|
|
FROM
|
|
|
ctop_user_allocation t
|
|
|
|
|
|
- LEFT JOIN application.kuaishou_campaign_report_daily_dw t1 ON t.account_id = t1.account_id
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_campaign t1 ON t.account_id = t1.account_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
<if test="projectId != null">
|
|
@@ -506,15 +506,15 @@
|
|
|
t2.campaignName campaignName ,
|
|
|
sum(t2.charge) charge,
|
|
|
ROUND(sum(t2.charge) / #{disCount}, 3) cashCost,
|
|
|
- sum(t2.aclick + t2.show) photoShow,
|
|
|
+ sum(t2.aclick + t2.photo_show) photoShow,
|
|
|
sum(t2.photo_click + t2.bclick) photoClick,
|
|
|
(
|
|
|
CASE
|
|
|
- WHEN sum(t2.show) != 0 THEN
|
|
|
+ WHEN sum(t2.photo_show) != 0 THEN
|
|
|
CONCAT(
|
|
|
CAST( ROUND(
|
|
|
(
|
|
|
- sum(t2.photo_click + t2.bclick) / sum(t2.show + t2.aclick)
|
|
|
+ sum(t2.photo_click + t2.bclick) / sum(t2.photo_show + t2.aclick)
|
|
|
) * 100,
|
|
|
3
|
|
|
) AS CHAR)
|
|
@@ -527,10 +527,10 @@
|
|
|
) clickRate,
|
|
|
(
|
|
|
CASE
|
|
|
- WHEN sum(t2.show) != 0 THEN
|
|
|
+ WHEN sum(t2.photo_show) != 0 THEN
|
|
|
ROUND(
|
|
|
(
|
|
|
- sum(t2.charge) / sum(t2.show)
|
|
|
+ sum(t2.charge) / sum(t2.photo_show)
|
|
|
) * 1000,
|
|
|
3
|
|
|
)
|
|
@@ -651,7 +651,7 @@
|
|
|
) campaignName
|
|
|
FROM
|
|
|
ctop_user_allocation t
|
|
|
- LEFT JOIN application.kuaishou_campaign_report_daily_dw t1 ON t.account_id = t1.account_id
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_campaign t1 ON t.account_id = t1.account_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
<if test="projectId != null">
|