Browse Source

盯盘2.0功能 查询数据去除通过账户关闭状态过滤

zhaoxian 4 năm trước cách đây
mục cha
commit
16eda99774

+ 1 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountDailyMapper.xml

@@ -397,7 +397,6 @@
         ) t6 ON t6.account_id = t2.account_id
         where stat_date >= #{startTime}
         AND stat_date <= #{endTime}
-        and t2.account_status = 0
         <if test="userIds != null">
             AND t2.user_id IN
             <foreach item="id" index="index" collection="userIds"
@@ -423,7 +422,6 @@
         LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
         where stat_date &gt;= #{startTime}
         AND stat_date &lt;= #{endTime}
-        and t2.account_status = 0
         <if test="userIds != null">
             AND t2.user_id IN
             <foreach item="id" index="index" collection="userIds"
@@ -493,7 +491,6 @@
         FROM (
         SELECT DISTINCT project_id,user_id
         FROM ctop_user_allocation
-        where account_status = 0
         ) t
         GROUP BY project_id
         ) t4 ON t4.project_id = t3.id
@@ -513,8 +510,7 @@
         SELECT project_id ,count(1) as 'accountCount' FROM (
         SELECT i2.project_id,i2.account_id FROM ctop_etl_kuaishou_report_account_daily i1
         LEFT JOIN ctop_user_allocation i2 ON i1.account_id = i2.account_id
-        where account_status = 0
-        AND i1.stat_date &gt;= #{startTime}
+        where i1.stat_date &gt;= #{startTime}
         AND i1.stat_date &lt;= #{endTime}
         GROUP BY project_id,i1.account_id ) t GROUP BY t.project_id
         ) t7 on t2.project_id = t7.project_id

+ 2 - 10
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountHourlyMapper.xml

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