|
@@ -12,11 +12,13 @@
|
|
|
FROM
|
|
|
application.bytedance_advertiser_report_hourly_dw
|
|
|
WHERE stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
|
|
|
+ <if test="accountIds !=null">
|
|
|
AND account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="queryTodayReportByAccount" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -37,11 +39,13 @@
|
|
|
FROM application.bytedance_advertiser_report_hourly_dw t1
|
|
|
WHERE t1.stat_datetime = DATE_FORMAT(#{statDate}, '%Y%m%d' )
|
|
|
and t1.`hour` <= #{hour}
|
|
|
+ <if test="accountIds !=null">
|
|
|
AND t1.account_id IN
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
group by t1.account_id
|
|
|
order by ${target} ${order}
|
|
|
</select>
|
|
@@ -57,11 +61,13 @@
|
|
|
WHERE
|
|
|
stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
|
|
|
and `hour` <= #{hour}
|
|
|
+ <if test="accountIds !=null">
|
|
|
AND account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="querySumByHour" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -72,11 +78,13 @@
|
|
|
WHERE
|
|
|
t1.stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
|
|
|
and t1.`hour` <= #{hour}
|
|
|
+ <if test="accountIds !=null">
|
|
|
AND t1.account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="queryTodayDetailReportBy" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -90,11 +98,13 @@
|
|
|
application.bytedance_advertiser_report_hourly_dw
|
|
|
WHERE
|
|
|
stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
|
|
|
+ <if test="accountIds !=null">
|
|
|
AND account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
GROUP BY
|
|
|
`hour`
|
|
|
ORDER BY
|
|
@@ -107,11 +117,13 @@
|
|
|
FROM application.bytedance_advertiser_report_hourly_dw t1
|
|
|
WHERE t1.stat_datetime <=DATE_FORMAT(#{endDate},'%Y%m%d')
|
|
|
AND t1.stat_datetime >= DATE_FORMAT(#{startDate},'%Y%m%d')
|
|
|
+ <if test="accountIds !=null">
|
|
|
AND t1.account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="querySumByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -123,11 +135,13 @@
|
|
|
application.bytedance_advertiser_report_hourly_dw
|
|
|
WHERE stat_datetime <= DATE_FORMAT(#{endDate},'%Y%m%d')
|
|
|
AND stat_datetime >= DATE_FORMAT(#{startDate},'%Y%m%d')
|
|
|
- AND account_id in
|
|
|
+ <if test="accountIds !=null">
|
|
|
+ AND account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="querySumByDateGroupAccount" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -140,11 +154,13 @@
|
|
|
WHERE
|
|
|
t1.stat_datetime <= DATE_FORMAT(#{endDate},'%Y%m%d')
|
|
|
AND t1.stat_datetime >= DATE_FORMAT(#{startDate},'%Y%m%d')
|
|
|
- AND t1.account_id in
|
|
|
+ <if test="accountIds !=null">
|
|
|
+ AND t1.account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
group by t1.account_id
|
|
|
order by ${target} ${order}
|
|
|
</select>
|
|
@@ -160,11 +176,13 @@
|
|
|
WHERE
|
|
|
t1.stat_datetime <= DATE_FORMAT(#{endDate},'%Y%m%d')
|
|
|
AND t1.stat_datetime >= DATE_FORMAT(#{startDate},'%Y%m%d')
|
|
|
+ <if test="accountIds !=null">
|
|
|
AND t1.account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
group by t1.stat_datetime
|
|
|
order by ${target} ${order}
|
|
|
</select>
|
|
@@ -180,11 +198,13 @@
|
|
|
application.bytedance_advertiser_report_daily_dw
|
|
|
WHERE stat_datetime <= DATE_FORMAT(#{endDate},'%Y%m%d')
|
|
|
AND stat_datetime >= DATE_FORMAT(#{startDate},'%Y%m%d')
|
|
|
+ <if test="accountIds !=null">
|
|
|
AND account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
group by stat_datetime
|
|
|
order by stat_datetime
|
|
|
</select>
|
|
@@ -199,11 +219,13 @@
|
|
|
FROM application.bytedance_advertiser_report_daily_dw t1
|
|
|
WHERE t1.stat_datetime <= DATE_FORMAT(#{endDate},'%Y%m%d')
|
|
|
AND t1.stat_datetime >= DATE_FORMAT(#{startDate},'%Y%m%d')
|
|
|
+ <if test="accountIds !=null">
|
|
|
AND t1.account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ </if>
|
|
|
group by DATE_FORMAT(t1.stat_datetime, '%Y-%m')
|
|
|
order by t1.stat_datetime
|
|
|
</select>
|