|
@@ -289,7 +289,6 @@
|
|
FROM ctop_etl_kuaishou_report_account_hourly t1
|
|
FROM ctop_etl_kuaishou_report_account_hourly t1
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
where stat_date = #{startTime}
|
|
where stat_date = #{startTime}
|
|
- and t2.account_status = 0
|
|
|
|
<if test="userIds != null">
|
|
<if test="userIds != null">
|
|
AND t2.user_id IN
|
|
AND t2.user_id IN
|
|
<foreach item="id" index="index" collection="userIds"
|
|
<foreach item="id" index="index" collection="userIds"
|
|
@@ -371,7 +370,6 @@
|
|
where state =1
|
|
where state =1
|
|
) t6 ON t6.account_id = t2.account_id
|
|
) t6 ON t6.account_id = t2.account_id
|
|
where stat_date = #{startTime}
|
|
where stat_date = #{startTime}
|
|
- and t2.account_status = 0
|
|
|
|
<if test="userIds != null">
|
|
<if test="userIds != null">
|
|
AND t2.user_id IN
|
|
AND t2.user_id IN
|
|
<foreach item="id" index="index" collection="userIds"
|
|
<foreach item="id" index="index" collection="userIds"
|
|
@@ -412,7 +410,6 @@
|
|
FROM ctop_etl_kuaishou_report_account_hourly t1
|
|
FROM ctop_etl_kuaishou_report_account_hourly t1
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
WHERE stat_date = #{today}
|
|
WHERE stat_date = #{today}
|
|
- AND t2.account_status = 0
|
|
|
|
AND t2.user_id IN
|
|
AND t2.user_id IN
|
|
<foreach item="id" index="index" collection="userIds"
|
|
<foreach item="id" index="index" collection="userIds"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|
|
@@ -440,8 +437,7 @@
|
|
SELECT user_id,COUNT(1) 'accountCount' FROM ctop_user_allocation i1
|
|
SELECT user_id,COUNT(1) 'accountCount' FROM ctop_user_allocation i1
|
|
INNER JOIN ctop_etl_kuaishou_report_account_hourly i2 ON i1.account_id = i2.account_id
|
|
INNER JOIN ctop_etl_kuaishou_report_account_hourly i2 ON i1.account_id = i2.account_id
|
|
AND i2.stat_date = #{today}
|
|
AND i2.stat_date = #{today}
|
|
- WHERE
|
|
|
|
- account_status = 0 AND user_id IN
|
|
|
|
|
|
+ WHERE user_id IN
|
|
<foreach item="id" index="index" collection="userIds"
|
|
<foreach item="id" index="index" collection="userIds"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|
|
#{id}
|
|
#{id}
|
|
@@ -539,7 +535,6 @@
|
|
</foreach>
|
|
</foreach>
|
|
) t9 ON t2.user_id = t9.id
|
|
) t9 ON t2.user_id = t9.id
|
|
WHERE t1.stat_date = #{today}
|
|
WHERE t1.stat_date = #{today}
|
|
- AND t2.account_status = 0
|
|
|
|
AND t2.user_id IN
|
|
AND t2.user_id IN
|
|
<foreach item="id" index="index" collection="userIds"
|
|
<foreach item="id" index="index" collection="userIds"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|
|
@@ -564,7 +559,7 @@
|
|
(
|
|
(
|
|
SELECT count(1) FROM ctop_etl_kuaishou_report_account_hourly i1
|
|
SELECT count(1) FROM ctop_etl_kuaishou_report_account_hourly i1
|
|
LEFT JOIN ctop_user_allocation i2 ON i1.account_id = i2.account_id
|
|
LEFT JOIN ctop_user_allocation i2 ON i1.account_id = i2.account_id
|
|
- where project_id = t3.id and account_status = 0
|
|
|
|
|
|
+ where project_id = t3.id
|
|
AND i1.stat_date = #{startTime}) as 'accountCount',
|
|
AND i1.stat_date = #{startTime}) as 'accountCount',
|
|
IFNULL(t4.userCount,0) as 'userCount'
|
|
IFNULL(t4.userCount,0) as 'userCount'
|
|
FROM ctop_etl_kuaishou_report_account_hourly t1
|
|
FROM ctop_etl_kuaishou_report_account_hourly t1
|
|
@@ -575,7 +570,6 @@
|
|
FROM (
|
|
FROM (
|
|
SELECT DISTINCT project_id,user_id
|
|
SELECT DISTINCT project_id,user_id
|
|
FROM ctop_user_allocation
|
|
FROM ctop_user_allocation
|
|
- where account_status = 0
|
|
|
|
) t
|
|
) t
|
|
GROUP BY project_id
|
|
GROUP BY project_id
|
|
) t4 ON t4.project_id = t3.id
|
|
) t4 ON t4.project_id = t3.id
|
|
@@ -604,7 +598,6 @@
|
|
GROUP BY i1.account_id
|
|
GROUP BY i1.account_id
|
|
) t6 ON t2.account_id = t6.account_id
|
|
) t6 ON t2.account_id = t6.account_id
|
|
where stat_date = #{startTime}
|
|
where stat_date = #{startTime}
|
|
- and t2.account_status = 0
|
|
|
|
AND t2.user_id IN
|
|
AND t2.user_id IN
|
|
<foreach item="id" index="index" collection="userIds"
|
|
<foreach item="id" index="index" collection="userIds"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|
|
@@ -626,7 +619,6 @@
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
LEFT JOIN ctop_project t3 ON t2.project_id = t3.id
|
|
LEFT JOIN ctop_project t3 ON t2.project_id = t3.id
|
|
where stat_date = #{startTime}
|
|
where stat_date = #{startTime}
|
|
- and t2.account_status = 0
|
|
|
|
AND t2.user_id in
|
|
AND t2.user_id in
|
|
<foreach item="id" index="index" collection="userIds"
|
|
<foreach item="id" index="index" collection="userIds"
|
|
open="(" separator="," close=")">
|
|
open="(" separator="," close=")">
|