|
@@ -114,55 +114,18 @@
|
|
|
|
|
|
<select id="querybusinessTypeReportForm" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="querybusinessTypeReportForm" resultType="com.alibaba.fastjson.JSONObject">
|
|
SELECT
|
|
SELECT
|
|
- statDate as statDate,
|
|
|
|
- accountId as accountId,
|
|
|
|
- businessInterestTags as businessInterestTags,
|
|
|
|
- SUM(photoShow) as photoShow,
|
|
|
|
- SUM(photoClick) as photoClick,
|
|
|
|
- SUM(aclick) as aclick,
|
|
|
|
- SUM(bclick) as bclick,
|
|
|
|
- ROUND(SUM(photoClick)/SUM(photoShow)*100,2) as photoClickRatio,
|
|
|
|
- ROUND(SUM(bclick)/SUM(aclick)*100,2) as actionRatio
|
|
|
|
- FROM(
|
|
|
|
- SELECT
|
|
|
|
- stat_date as statDate,
|
|
|
|
- account_id as accountId,
|
|
|
|
- '其他' as businessInterestTags,
|
|
|
|
- SUM(photo_show) as photoShow,
|
|
|
|
- SUM(photo_click) as photoClick,
|
|
|
|
- SUM(aclick) as aclick,
|
|
|
|
- SUM(bclick) as bclick
|
|
|
|
- FROM ctop_kuaishou_audience_report_daily_account t
|
|
|
|
- where 1=1
|
|
|
|
- <if test="accountId != null">
|
|
|
|
- and account_id = #{accountId}
|
|
|
|
- </if>
|
|
|
|
- <if test="startTime != null">
|
|
|
|
- AND stat_date >= #{startTime}
|
|
|
|
- </if>
|
|
|
|
- <if test="endTime != null">
|
|
|
|
- AND stat_date <= #{endTime}
|
|
|
|
- </if>
|
|
|
|
- AND audience_type = 'businessInterestTags'
|
|
|
|
- GROUP BY business_interest_tags
|
|
|
|
- ORDER BY photoShow
|
|
|
|
- limit 0,#{count}
|
|
|
|
- ) t1
|
|
|
|
- union
|
|
|
|
- (
|
|
|
|
- SELECT
|
|
|
|
stat_date as statDate,
|
|
stat_date as statDate,
|
|
account_id as accountId,
|
|
account_id as accountId,
|
|
business_interest_tags as businessInterestTags ,
|
|
business_interest_tags as businessInterestTags ,
|
|
SUM(photo_show) as photoShow,
|
|
SUM(photo_show) as photoShow,
|
|
SUM(photo_click) as photoClick,
|
|
SUM(photo_click) as photoClick,
|
|
|
|
+ sum(charge) as totalCost,
|
|
SUM(aclick) as aclick,
|
|
SUM(aclick) as aclick,
|
|
SUM(bclick) as bclick,
|
|
SUM(bclick) as bclick,
|
|
ROUND(SUM(photo_click)/SUM(photo_show)*100,2) as photoClickRatio,
|
|
ROUND(SUM(photo_click)/SUM(photo_show)*100,2) as photoClickRatio,
|
|
ROUND(SUM(bclick)/SUM(aclick)*100,2) as actionRatio
|
|
ROUND(SUM(bclick)/SUM(aclick)*100,2) as actionRatio
|
|
FROM ctop_kuaishou_audience_report_daily_account
|
|
FROM ctop_kuaishou_audience_report_daily_account
|
|
where 1=1
|
|
where 1=1
|
|
- AND business_interest_tags != '其他'
|
|
|
|
<if test="accountId != null">
|
|
<if test="accountId != null">
|
|
and account_id = #{accountId}
|
|
and account_id = #{accountId}
|
|
</if>
|
|
</if>
|
|
@@ -174,9 +137,8 @@
|
|
</if>
|
|
</if>
|
|
AND audience_type = 'businessInterestTags'
|
|
AND audience_type = 'businessInterestTags'
|
|
GROUP BY business_interest_tags
|
|
GROUP BY business_interest_tags
|
|
- ORDER BY photoShow desc
|
|
|
|
- limit 9
|
|
|
|
- )
|
|
|
|
|
|
+ ORDER BY totalCost desc
|
|
|
|
+ limit 10
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
@@ -201,4 +163,4 @@
|
|
</if>
|
|
</if>
|
|
) as tt
|
|
) as tt
|
|
</select>
|
|
</select>
|
|
-</mapper>
|
|
|
|
|
|
+</mapper>
|