Explorar o código

盯盘2.0功能,查询预算数据添加状态条件

zhaoxian %!s(int64=4) %!d(string=hai) anos
pai
achega
904f4cfc62

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

@@ -285,13 +285,13 @@
                      AND media_id =2
                      AND media_id =2
                      GROUP BY user_id) t) as 'totle'
                      GROUP BY user_id) t) as 'totle'
                  FROM (
                  FROM (
-                     SELECT sum(charge) as 'charge', t2.user_id 'userId' FROM ctop_etl_kuaishou_report_account_daily t1
+                     SELECT sum (charge) as 'charge', t2.user_id 'userId' FROM ctop_etl_kuaishou_report_account_daily 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 t1.stat_date >= #{mStartDate}
                      WHERE t1.stat_date >= #{mStartDate}
                      AND t1.stat_date <= #{today}
                      AND t1.stat_date <= #{today}
                      AND media_id =2
                      AND media_id =2
                      GROUP BY user_id
                      GROUP BY user_id
-                     ORDER BY SUM(charge) DESC
+                     ORDER BY SUM (charge) DESC
                      ) t, (select @rownum := 0) a
                      ) t, (select @rownum := 0) a
              ) tt
              ) tt
         WHERE tt.userId = #{userId}
         WHERE tt.userId = #{userId}
@@ -323,6 +323,7 @@
         where stat_date >= #{startTime}
         where stat_date >= #{startTime}
         AND stat_date <= #{endTime}
         AND stat_date <= #{endTime}
         AND t2.user_id = #{userId}
         AND t2.user_id = #{userId}
+        AND t6.state = 1
         GROUP BY t2.account_id
         GROUP BY t2.account_id
         <if test="sortCode != '' and sortCode != null ">
         <if test="sortCode != '' and sortCode != null ">
             ORDER BY ${sortCode}
             ORDER BY ${sortCode}
@@ -391,6 +392,7 @@
         LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
         LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
         where stat_date &gt;= #{startTime}
         where stat_date &gt;= #{startTime}
         AND stat_date &lt;= #{endTime}
         AND stat_date &lt;= #{endTime}
+        AND t6.state = 1
         <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"

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

@@ -364,6 +364,7 @@
         ) t5 ON t2.user_id = t5.id
         ) t5 ON t2.user_id = t5.id
         LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
         LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
         where stat_date = #{startTime}
         where stat_date = #{startTime}
+        AND t6.state = 1
         <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"