|
@@ -15,7 +15,13 @@
|
|
|
|
|
|
<select id="selectReportByMap" parameterType="java.util.Map" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT
|
|
|
- t1.system_type systemType,
|
|
|
+ (case when t1.system_type = 'android'
|
|
|
+ then '安卓'
|
|
|
+ when t1.system_type = 'ios'
|
|
|
+ then 'ios'
|
|
|
+ else '-'
|
|
|
+ end
|
|
|
+ ) as systemType,
|
|
|
t1.auth_name authName,
|
|
|
ROUND(sum(t2.charge) / #{disCount},3) charge,
|
|
|
sum(t2.activation) activation,
|
|
@@ -64,7 +70,13 @@
|
|
|
|
|
|
<select id="selectSumReportByMap" parameterType="java.util.Map" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT
|
|
|
- t1.system_type systemType,
|
|
|
+ (case when t1.system_type = 'android'
|
|
|
+ then '安卓'
|
|
|
+ when t1.system_type = 'ios'
|
|
|
+ then 'ios'
|
|
|
+ else '-'
|
|
|
+ end
|
|
|
+ ) as systemType,
|
|
|
#{dateDesc} authName,
|
|
|
ROUND(sum(t2.charge) / #{disCount},3) charge,
|
|
|
sum(t2.activation) activation,
|
|
@@ -121,19 +133,25 @@
|
|
|
'未知'
|
|
|
END
|
|
|
) media,
|
|
|
- t1.system_type systemType,
|
|
|
- t2.stat_date statDate,
|
|
|
+ (case when t1.system_type = 'android'
|
|
|
+ then '安卓'
|
|
|
+ when t1.system_type = 'ios'
|
|
|
+ then 'ios'
|
|
|
+ else '-'
|
|
|
+ end
|
|
|
+ ) as systemType,
|
|
|
+ DATE_FORMAT(t2.stat_date,'%Y/%c/%d') statDate,
|
|
|
sum(t2.charge) charge,
|
|
|
ROUND(sum(t2.charge) / #{disCount}, 3) cashCost,
|
|
|
- sum(t2.photo_show) photoShow,
|
|
|
- sum(t2.photo_click) photoClick,
|
|
|
+ sum(t2.aclick + t2.photo_show) photoShow,
|
|
|
+ sum(t2.photo_click + t2.bclick) photoClick,
|
|
|
(
|
|
|
CASE
|
|
|
WHEN sum(t2.photo_show) != 0 THEN
|
|
|
CONCAT(
|
|
|
CAST(ROUND(
|
|
|
(
|
|
|
- sum(t2.photo_click) / sum(t2.photo_show)
|
|
|
+ sum(t2.photo_click + t2.bclick) / sum(t2.photo_show + t2.aclick)
|
|
|
) * 100,
|
|
|
3
|
|
|
) AS CHAR)
|
|
@@ -281,19 +299,25 @@
|
|
|
'未知'
|
|
|
END
|
|
|
) media,
|
|
|
- t2.system_type systemType,
|
|
|
- t2.stat_date statDate,
|
|
|
+ (case when t2.system_type = 'android'
|
|
|
+ then '安卓'
|
|
|
+ when t2.system_type = 'ios'
|
|
|
+ then 'ios'
|
|
|
+ else '-'
|
|
|
+ end
|
|
|
+ ) as systemType,
|
|
|
+ DATE_FORMAT(t2.stat_date,'%Y/%c/%d') statDate,
|
|
|
sum(t2.charge) charge,
|
|
|
ROUND(sum(t2.charge) / #{disCount}, 3) cashCost,
|
|
|
- sum(t2.photo_show) photoShow,
|
|
|
- sum(t2.photo_click) photoClick,
|
|
|
+ sum(t2.aclick + t2.photo_show) photoShow,
|
|
|
+ sum(t2.photo_click + t2.bclick) photoClick,
|
|
|
(
|
|
|
CASE
|
|
|
WHEN sum(t2.photo_show) != 0 THEN
|
|
|
CONCAT(
|
|
|
CAST( ROUND(
|
|
|
(
|
|
|
- sum(t2.photo_click) / sum(t2.photo_show)
|
|
|
+ sum(t2.photo_click + t2.bclick) / sum(t2.photo_show + t2.aclick)
|
|
|
) * 100,
|
|
|
3
|
|
|
) AS CHAR)
|
|
@@ -446,7 +470,7 @@
|
|
|
<if test="projectId != null">
|
|
|
and t.project_id = #{projectId}
|
|
|
</if>
|
|
|
- <if test="systemType != null">
|
|
|
+ <if test="statDate != null">
|
|
|
and t1.stat_date = #{statDate}
|
|
|
</if>
|
|
|
) t2
|
|
@@ -471,20 +495,26 @@
|
|
|
'未知'
|
|
|
END
|
|
|
) media,
|
|
|
- t2.system_type systemType,
|
|
|
- t2.stat_date statDate,
|
|
|
+ (case when t2.system_type = 'android'
|
|
|
+ then '安卓'
|
|
|
+ when t2.system_type = 'ios'
|
|
|
+ then 'ios'
|
|
|
+ else '-'
|
|
|
+ end
|
|
|
+ ) as systemType,
|
|
|
+ DATE_FORMAT(t2.stat_date,'%Y/%c/%d') statDate,
|
|
|
t2.campaignName campaignName ,
|
|
|
sum(t2.charge) charge,
|
|
|
ROUND(sum(t2.charge) / #{disCount}, 3) cashCost,
|
|
|
- sum(t2.photo_show) photoShow,
|
|
|
- sum(t2.photo_click) photoClick,
|
|
|
+ sum(t2.aclick + t2.photo_show) photoShow,
|
|
|
+ sum(t2.photo_click + t2.bclick) photoClick,
|
|
|
(
|
|
|
CASE
|
|
|
WHEN sum(t2.photo_show) != 0 THEN
|
|
|
CONCAT(
|
|
|
CAST( ROUND(
|
|
|
(
|
|
|
- sum(t2.photo_click) / sum(t2.photo_show)
|
|
|
+ sum(t2.photo_click + t2.bclick) / sum(t2.photo_show + t2.aclick)
|
|
|
) * 100,
|
|
|
3
|
|
|
) AS CHAR)
|
|
@@ -626,7 +656,7 @@
|
|
|
<if test="projectId != null">
|
|
|
and t.project_id = #{projectId}
|
|
|
</if>
|
|
|
- <if test="systemType != null">
|
|
|
+ <if test="statDate != null">
|
|
|
and t1.stat_date = #{statDate}
|
|
|
</if>
|
|
|
) t2
|