|
@@ -56,26 +56,32 @@
|
|
FROM (
|
|
FROM (
|
|
SELECT sum(charge) as 'charge'
|
|
SELECT sum(charge) as 'charge'
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
- WHERE account_id in
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- and stat_date = DATE_FORMAT(#{statDay}, '%Y%m%d')
|
|
|
|
- <if test="hour !=null">
|
|
|
|
- AND hour <= #{hour}
|
|
|
|
- </if>
|
|
|
|
|
|
+ <where>
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id in
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ and stat_date = DATE_FORMAT(#{statDay}, '%Y%m%d')
|
|
|
|
+ <if test="hour !=null">
|
|
|
|
+ AND hour <= #{hour}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
) t
|
|
) t
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
(
|
|
(
|
|
SELECT sum(charge) as 'charge'
|
|
SELECT sum(charge) as 'charge'
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
- WHERE account_id in
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- and stat_date = DATE_FORMAT(DATE_ADD(#{statDay},INTERVAL -1 day), '%Y%m%d')
|
|
|
|
|
|
+ where stat_date = DATE_FORMAT(DATE_ADD(#{statDay},INTERVAL -1 day), '%Y%m%d')
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id in
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
<if test="hour !=null">
|
|
<if test="hour !=null">
|
|
AND hour <= #{hour}
|
|
AND hour <= #{hour}
|
|
</if>
|
|
</if>
|
|
@@ -88,12 +94,15 @@
|
|
FROM (
|
|
FROM (
|
|
SELECT sum(cost) as 'charge'
|
|
SELECT sum(cost) as 'charge'
|
|
FROM application.bytedance_advertiser_report_hourly_dw
|
|
FROM application.bytedance_advertiser_report_hourly_dw
|
|
- WHERE account_id in
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- and stat_datetime = DATE_FORMAT(#{statDay}, '%Y%m%d')
|
|
|
|
|
|
+ where stat_datetime = DATE_FORMAT(#{statDay}, '%Y%m%d')
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ and account_id in
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+
|
|
<if test="hour !=null">
|
|
<if test="hour !=null">
|
|
AND hour <= #{hour}
|
|
AND hour <= #{hour}
|
|
</if>
|
|
</if>
|
|
@@ -102,12 +111,14 @@
|
|
(
|
|
(
|
|
SELECT sum(cost) as 'charge'
|
|
SELECT sum(cost) as 'charge'
|
|
FROM application.bytedance_advertiser_report_hourly_dw
|
|
FROM application.bytedance_advertiser_report_hourly_dw
|
|
- WHERE account_id in
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- and stat_datetime = DATE_FORMAT(DATE_ADD(#{statDay},INTERVAL -1 day), '%Y%m%d')
|
|
|
|
|
|
+ WHERE stat_datetime = DATE_FORMAT(DATE_ADD(#{statDay},INTERVAL -1 day), '%Y%m%d')
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ and account_id in
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
<if test="hour !=null">
|
|
<if test="hour !=null">
|
|
AND hour <= #{hour}
|
|
AND hour <= #{hour}
|
|
</if>
|
|
</if>
|
|
@@ -128,7 +139,7 @@
|
|
|
|
|
|
<select id="queryTtManydaysCharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryTtManydaysCharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
SELECT DATE_FORMAT(stat_datetime,'%Y-%m-%d') as 'statDate', IFNULL(sum(cost), 0.00) as 'charge'
|
|
SELECT DATE_FORMAT(stat_datetime,'%Y-%m-%d') as 'statDate', IFNULL(sum(cost), 0.00) as 'charge'
|
|
- FROM application.bytedance_advertiser_report_daily_dw
|
|
|
|
|
|
+ FROM application.bytedance_advertiser_report_hourly_dw
|
|
WHERE account_id in
|
|
WHERE account_id in
|
|
<foreach collection="accountIds" item="id" separator=","
|
|
<foreach collection="accountIds" item="id" separator=","
|
|
open="(" close=")">
|
|
open="(" close=")">
|
|
@@ -142,14 +153,17 @@
|
|
|
|
|
|
<select id="queryKsManydaysCharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryKsManydaysCharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
SELECT DATE_FORMAT(stat_date,'%Y-%m-%d') as 'statDate', IFNULL(sum(charge), 0.00) as 'charge'
|
|
SELECT DATE_FORMAT(stat_date,'%Y-%m-%d') as 'statDate', IFNULL(sum(charge), 0.00) as 'charge'
|
|
- FROM application.kuaishou_account_report_daily_dw
|
|
|
|
- WHERE account_id in
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- and stat_date >= DATE_FORMAT(#{startTime}, '%Y%m%d')
|
|
|
|
|
|
+ FROM application.kuaishou_account_report_hourly_dw
|
|
|
|
+ WHERE
|
|
|
|
+ stat_date >= DATE_FORMAT(#{startTime}, '%Y%m%d')
|
|
and stat_date <= DATE_FORMAT(#{endTime}, '%Y%m%d')
|
|
and stat_date <= DATE_FORMAT(#{endTime}, '%Y%m%d')
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ and account_id in
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
GROUP BY stat_date
|
|
GROUP BY stat_date
|
|
order by stat_date
|
|
order by stat_date
|
|
</select>
|
|
</select>
|
|
@@ -157,13 +171,16 @@
|
|
<select id="queryKsManydaysTotalCharge" resultType="String">
|
|
<select id="queryKsManydaysTotalCharge" resultType="String">
|
|
SELECT IFNULL(sum(charge), 0.00)
|
|
SELECT IFNULL(sum(charge), 0.00)
|
|
FROM application.kuaishou_account_report_daily_dw
|
|
FROM application.kuaishou_account_report_daily_dw
|
|
- WHERE account_id in
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- and stat_date >= DATE_FORMAT(#{startDay}, '%Y%m%d')
|
|
|
|
|
|
+ WHERE
|
|
|
|
+ stat_date >= DATE_FORMAT(#{startDay}, '%Y%m%d')
|
|
and stat_date < DATE_FORMAT(#{endDay}, '%Y%m%d')
|
|
and stat_date < DATE_FORMAT(#{endDay}, '%Y%m%d')
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ and account_id in
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryKsRealCharged" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryKsRealCharged" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -177,28 +194,32 @@
|
|
IFNULL( sum( real_charged_in_yuan ), 0.00 ) AS 'realCharged'
|
|
IFNULL( sum( real_charged_in_yuan ), 0.00 ) AS 'realCharged'
|
|
FROM
|
|
FROM
|
|
application.app_kuaishou_agent_report_d
|
|
application.app_kuaishou_agent_report_d
|
|
- WHERE
|
|
|
|
- account_id IN
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- AND stat_date >= DATE_FORMAT( #{monthFirstday}, '%Y%m%d' )
|
|
|
|
|
|
+ WHERE stat_date >= DATE_FORMAT( #{monthFirstday}, '%Y%m%d' )
|
|
AND stat_date <= DATE_FORMAT( #{statDay}, '%Y%m%d' )
|
|
AND stat_date <= DATE_FORMAT( #{statDay}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id IN
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+
|
|
) thisMonth
|
|
) thisMonth
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
IFNULL( sum( real_charged_in_yuan ), 0.00 ) AS 'realCharged'
|
|
IFNULL( sum( real_charged_in_yuan ), 0.00 ) AS 'realCharged'
|
|
FROM
|
|
FROM
|
|
application.app_kuaishou_agent_report_d
|
|
application.app_kuaishou_agent_report_d
|
|
- WHERE
|
|
|
|
- account_id IN
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- AND stat_date >= DATE_FORMAT(#{lastMonthFirstday}, '%Y%m%d' )
|
|
|
|
|
|
+ WHERE stat_date >= DATE_FORMAT(#{lastMonthFirstday}, '%Y%m%d' )
|
|
AND stat_date < DATE_FORMAT(#{monthFirstday}, '%Y%m%d' )
|
|
AND stat_date < DATE_FORMAT(#{monthFirstday}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND
|
|
|
|
+ account_id IN
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
) lastMonth ON 1=1
|
|
) lastMonth ON 1=1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -213,28 +234,31 @@
|
|
IFNULL( sum( cash_cost ), 0.00 ) AS 'realCharged'
|
|
IFNULL( sum( cash_cost ), 0.00 ) AS 'realCharged'
|
|
FROM
|
|
FROM
|
|
application.app_bytedance_agent_report_d
|
|
application.app_bytedance_agent_report_d
|
|
- WHERE
|
|
|
|
- account_id IN
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- AND stat_datetime >= DATE_FORMAT( #{monthFirstday}, '%Y%m%d' )
|
|
|
|
|
|
+ WHERE stat_datetime >= DATE_FORMAT( #{monthFirstday}, '%Y%m%d' )
|
|
AND stat_datetime <= DATE_FORMAT( #{statDay}, '%Y%m%d' )
|
|
AND stat_datetime <= DATE_FORMAT( #{statDay}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND
|
|
|
|
+ account_id IN
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
) thisMonth
|
|
) thisMonth
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
IFNULL( sum( cash_cost ), 0.00 ) AS 'realCharged'
|
|
IFNULL( sum( cash_cost ), 0.00 ) AS 'realCharged'
|
|
FROM
|
|
FROM
|
|
application.app_bytedance_agent_report_d
|
|
application.app_bytedance_agent_report_d
|
|
- WHERE
|
|
|
|
- account_id IN
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- AND stat_datetime >= DATE_FORMAT(#{lastMonthFirstday}, '%Y%m%d' )
|
|
|
|
|
|
+ WHERE stat_datetime >= DATE_FORMAT(#{lastMonthFirstday}, '%Y%m%d' )
|
|
AND stat_datetime < DATE_FORMAT(#{monthFirstday}, '%Y%m%d' )
|
|
AND stat_datetime < DATE_FORMAT(#{monthFirstday}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id IN
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
) lastMonth ON 1=1
|
|
) lastMonth ON 1=1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -269,19 +293,21 @@
|
|
FROM
|
|
FROM
|
|
`jeecg-boot`.ctop_project_member t1
|
|
`jeecg-boot`.ctop_project_member t1
|
|
LEFT JOIN `jeecg-boot`.ctop_project t2 ON t1.project_id = t2.id
|
|
LEFT JOIN `jeecg-boot`.ctop_project t2 ON t1.project_id = t2.id
|
|
- WHERE t1.user_id IN
|
|
|
|
- <foreach collection="userIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
|
|
+ WHERE t1.project_name IS NOT NULL
|
|
|
|
+ AND t1.project_name != ''
|
|
|
|
+ <if test="userIds !=null and userIds.size()>0">
|
|
|
|
+ AND t1.user_id IN
|
|
|
|
+ <foreach collection="userIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
<if test='mediaId ==2'>
|
|
<if test='mediaId ==2'>
|
|
AND (t2.media_id = 2 or t2.media_id = 4)
|
|
AND (t2.media_id = 2 or t2.media_id = 4)
|
|
</if>
|
|
</if>
|
|
<if test='mediaId ==1'>
|
|
<if test='mediaId ==1'>
|
|
AND (t2.media_id = 1 or t2.media_id = 3)
|
|
AND (t2.media_id = 1 or t2.media_id = 3)
|
|
</if>
|
|
</if>
|
|
- AND t1.project_name IS NOT NULL
|
|
|
|
- AND t1.project_name != ''
|
|
|
|
)
|
|
)
|
|
GROUP BY
|
|
GROUP BY
|
|
t1.account_id
|
|
t1.account_id
|
|
@@ -315,12 +341,14 @@
|
|
<select id="queryKsHourList" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryKsHourList" resultType="com.alibaba.fastjson.JSONObject">
|
|
SELECT hour,sum(charge) as 'charge'
|
|
SELECT hour,sum(charge) as 'charge'
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
- WHERE account_id in
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- and stat_date = DATE_FORMAT(#{statDay}, '%Y%m%d' )
|
|
|
|
|
|
+ WHERE stat_date = DATE_FORMAT(#{statDay}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id in
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
GROUP BY hour
|
|
GROUP BY hour
|
|
ORDER BY hour
|
|
ORDER BY hour
|
|
</select>
|
|
</select>
|
|
@@ -328,12 +356,14 @@
|
|
<select id="queryTtHourList" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryTtHourList" resultType="com.alibaba.fastjson.JSONObject">
|
|
SELECT hour,sum(cost) as 'charge'
|
|
SELECT hour,sum(cost) as 'charge'
|
|
FROM application.bytedance_advertiser_report_hourly_dw
|
|
FROM application.bytedance_advertiser_report_hourly_dw
|
|
- WHERE account_id in
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- and stat_datetime = DATE_FORMAT(#{statDay}, '%Y%m%d' )
|
|
|
|
|
|
+ WHERE stat_datetime = DATE_FORMAT(#{statDay}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id in
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
GROUP BY hour
|
|
GROUP BY hour
|
|
ORDER BY hour
|
|
ORDER BY hour
|
|
</select>
|
|
</select>
|
|
@@ -349,29 +379,31 @@
|
|
SELECT
|
|
SELECT
|
|
IFNULL( sum(cost), 0.00 ) AS 'charge'
|
|
IFNULL( sum(cost), 0.00 ) AS 'charge'
|
|
FROM
|
|
FROM
|
|
- application.bytedance_advertiser_report_daily_dw
|
|
|
|
- WHERE
|
|
|
|
- account_id IN
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- AND stat_datetime >= DATE_FORMAT(#{startTime}, '%Y%m%d' )
|
|
|
|
|
|
+ application.bytedance_advertiser_report_hourly_dw
|
|
|
|
+ WHERE stat_datetime >= DATE_FORMAT(#{startTime}, '%Y%m%d' )
|
|
AND stat_datetime <= DATE_FORMAT(#{endTime}, '%Y%m%d' )
|
|
AND stat_datetime <= DATE_FORMAT(#{endTime}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id IN
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
) this
|
|
) this
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
IFNULL( sum(cost), 0.00 ) AS 'charge'
|
|
IFNULL( sum(cost), 0.00 ) AS 'charge'
|
|
FROM
|
|
FROM
|
|
- application.bytedance_advertiser_report_daily_dw
|
|
|
|
- WHERE
|
|
|
|
- account_id IN
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- AND stat_datetime >= DATE_FORMAT( #{lastTimeStart}, '%Y%m%d' )
|
|
|
|
|
|
+ application.bytedance_advertiser_report_hourly_dw
|
|
|
|
+ WHERE stat_datetime >= DATE_FORMAT( #{lastTimeStart}, '%Y%m%d' )
|
|
AND stat_datetime <= DATE_FORMAT( #{lastTimeEnd}, '%Y%m%d' )
|
|
AND stat_datetime <= DATE_FORMAT( #{lastTimeEnd}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id IN
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
) last ON 1=1
|
|
) last ON 1=1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -386,29 +418,31 @@
|
|
SELECT
|
|
SELECT
|
|
IFNULL( sum(charge), 0.00 ) AS 'charge'
|
|
IFNULL( sum(charge), 0.00 ) AS 'charge'
|
|
FROM
|
|
FROM
|
|
- application.kuaishou_account_report_daily_dw
|
|
|
|
- WHERE
|
|
|
|
- account_id IN
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- AND stat_date >= DATE_FORMAT(#{startTime}, '%Y%m%d' )
|
|
|
|
|
|
+ application.kuaishou_account_report_hourly_dw
|
|
|
|
+ WHERE stat_date >= DATE_FORMAT(#{startTime}, '%Y%m%d' )
|
|
AND stat_date <= DATE_FORMAT(#{endTime}, '%Y%m%d' )
|
|
AND stat_date <= DATE_FORMAT(#{endTime}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id IN
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
) this
|
|
) this
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
IFNULL( sum(charge), 0.00 ) AS 'charge'
|
|
IFNULL( sum(charge), 0.00 ) AS 'charge'
|
|
FROM
|
|
FROM
|
|
- application.kuaishou_account_report_daily_dw
|
|
|
|
- WHERE
|
|
|
|
- account_id IN
|
|
|
|
- <foreach collection="accountIds" item="id" separator=","
|
|
|
|
- open="(" close=")">
|
|
|
|
- #{id}
|
|
|
|
- </foreach>
|
|
|
|
- AND stat_date >= DATE_FORMAT( #{lastTimeStart}, '%Y%m%d' )
|
|
|
|
|
|
+ application.kuaishou_account_report_hourly_dw
|
|
|
|
+ WHERE stat_date >= DATE_FORMAT( #{lastTimeStart}, '%Y%m%d' )
|
|
AND stat_date <= DATE_FORMAT( #{lastTimeEnd}, '%Y%m%d' )
|
|
AND stat_date <= DATE_FORMAT( #{lastTimeEnd}, '%Y%m%d' )
|
|
|
|
+ <if test="accountIds !=null and accountIds.size()>0">
|
|
|
|
+ AND account_id IN
|
|
|
|
+ <foreach collection="accountIds" item="id" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
) last ON 1=1
|
|
) last ON 1=1
|
|
</select>
|
|
</select>
|
|
|
|
|