瀏覽代碼

销售钉盘—— 列表查询bug修改

zxa 3 年之前
父節點
當前提交
e192027361

+ 16 - 16
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/ManagerSaleValueMapper.java

@@ -36,43 +36,43 @@ public interface ManagerSaleValueMapper extends BaseMapper<ManagerSaleValue> {
      * -----------------------------------------------------
      */
 
-    JSONObject queryTtTodayCharge(@Param("statDay") String statDay, @Param("hour") Integer hour, @Param("accountIds") List<Long> accountIds);
+    JSONObject queryTtTodayCharge(@Param("statDay") String statDay, @Param("hour") Integer hour, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
-    String queryTtManydaysTotalCharge(@Param("startDay") String startDay, @Param("endDay") String endDay, @Param("accountIds") List<Long> accountIds);
+    String queryTtManydaysTotalCharge(@Param("startDay") String startDay, @Param("endDay") String endDay, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
-    JSONObject queryTtRealCharged(@Param("lastMonthFirstday") String lastMonthFirstday, @Param("monthFirstday") String monthFirstday, @Param("statDay") String statDay, @Param("accountIds") List<Long> accountIds);
+    JSONObject queryTtRealCharged(@Param("lastMonthFirstday") String lastMonthFirstday, @Param("monthFirstday") String monthFirstday, @Param("statDay") String statDay, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
 
-    JSONObject queryKsTodayCharge(@Param("statDay") String statDay, @Param("hour") Integer hour, @Param("accountIds") List<Long> accountIds);
+    JSONObject queryKsTodayCharge(@Param("statDay") String statDay, @Param("hour") Integer hour, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
-    String queryKsManydaysTotalCharge(@Param("startDay") String startDay, @Param("endDay") String endDay, @Param("accountIds") List<Long> accountIds);
+    String queryKsManydaysTotalCharge(@Param("startDay") String startDay, @Param("endDay") String endDay, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
-    JSONObject queryKsRealCharged(@Param("lastMonthFirstday") String lastMonthFirstday, @Param("monthFirstday") String monthFirstday, @Param("statDay") String statDay, @Param("accountIds") List<Long> accountIds);
+    JSONObject queryKsRealCharged(@Param("lastMonthFirstday") String lastMonthFirstday, @Param("monthFirstday") String monthFirstday, @Param("statDay") String statDay, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
     Long getWeekly(@Param("userId") String userId, @Param("companyId") String companyId, @Param("mediaId") String mediaId);
 
     Long getMonthly(@Param("userId") String userId, @Param("companyId") String companyId, @Param("mediaId") String mediaId);
 
-    List<JSONObject> queryKsHourList(@Param("statDay") String statDay, @Param("accountIds") List<Long> accountIds);
+    List<JSONObject> queryKsHourList(@Param("statDay") String statDay, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
-    List<JSONObject> queryTtHourList(@Param("statDay") String statDay, @Param("accountIds") List<Long> accountIds);
+    List<JSONObject> queryTtHourList(@Param("statDay") String statDay, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
-    JSONObject queryTtManydaysChargeAndRoi(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("lastTimeStart") String lastTimeStart, @Param("lastTimeEnd") String lastTimeEnd, @Param("accountIds") List<Long> accountIds);
+    JSONObject queryTtManydaysChargeAndRoi(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("lastTimeStart") String lastTimeStart, @Param("lastTimeEnd") String lastTimeEnd, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
-    List<JSONObject> queryTtManydaysCharge(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("accountIds") List<Long> accountIds);
+    List<JSONObject> queryTtManydaysCharge(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
-    JSONObject queryKsManydaysChargeAndRoi(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("lastTimeStart") String lastTimeStart, @Param("lastTimeEnd") String lastTimeEnd, @Param("accountIds") List<Long> accountIds);
+    JSONObject queryKsManydaysChargeAndRoi(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("lastTimeStart") String lastTimeStart, @Param("lastTimeEnd") String lastTimeEnd, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
-    List<JSONObject> queryKsManydaysCharge(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("accountIds") List<Long> accountIds);
+    List<JSONObject> queryKsManydaysCharge(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("accountIds") List<Long> accountIds, @Param("companyId") String companyId);
 
     List<Long> querySalesDirectorProjectIds(@Param("companyId") String companyId, @Param("mediaId") String mediaId, @Param("userIds") List<String> saleTeaMber);
 
-    Long queryKsHourProjectTopTotal(@Param("accountIds") List<Long> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
+    Long queryKsHourProjectTopTotal(@Param("accountIds") List<Long> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("companyId") String companyId);
 
-    List<JSONObject> queryKsHourProjectTop(@Param("accountIds") List<Long> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("days") Long days, @Param("hour") Integer hour );
+    List<JSONObject> queryKsHourProjectTop(@Param("accountIds") List<Long> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("days") Long days, @Param("hour") Integer hour, @Param("companyId") String companyId);
 
-    Long queryTtHourProjectTopTotal(@Param("accountIds") List<Long> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
+    Long queryTtHourProjectTopTotal(@Param("accountIds") List<Long> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("companyId") String companyId);
 
-    List<JSONObject> queryTtHourProjectTop(@Param("accountIds") List<Long> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("days") Long days, @Param("hour") Integer hour );
+    List<JSONObject> queryTtHourProjectTop(@Param("accountIds") List<Long> accountIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("days") Long days, @Param("hour") Integer hour, @Param("companyId") String companyId);
 
 }

+ 25 - 3
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/ManagerSaleValueMapper.xml

@@ -46,16 +46,14 @@
         FROM `jeecg-boot`.ctop_project
         WHERE company_id = #{companyId}
         AND ( media_id = 1 OR media_id = 3 )
-        AND sale_id IN
         <if test="userIds !=null and userIds.size()>0">
-            AND t1.user_id IN
+            AND sale_id IN
             <foreach collection="userIds" item="id" separator=","
                      open="(" close=")">
                 #{id}
             </foreach>
         </if>
         )
-        AND company_id = #{companyId}
         GROUP BY
         account_id
     </select>
@@ -74,6 +72,7 @@
                     #{id}
                 </foreach>
             </if>
+            and company_id = #{companyId}
             and stat_date = DATE_FORMAT(#{statDay}, '%Y%m%d')
             <if test="hour !=null">
                 AND hour &lt;= #{hour}
@@ -85,6 +84,7 @@
         SELECT sum(charge) as 'charge'
         FROM application.kuaishou_account_report_hourly_dw
         where stat_date = DATE_FORMAT(DATE_ADD(#{statDay},INTERVAL -1 day), '%Y%m%d')
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -105,6 +105,7 @@
         SELECT sum(cost) as 'charge'
         FROM application.bytedance_advertiser_report_hourly_dw
         where stat_datetime = DATE_FORMAT(#{statDay}, '%Y%m%d')
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -140,6 +141,7 @@
         FROM application.bytedance_advertiser_report_hourly_dw
         WHERE stat_datetime >= DATE_FORMAT(#{startDay}, '%Y%m%d')
         and stat_datetime &lt;= DATE_FORMAT(#{endDay}, '%Y%m%d')
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -154,6 +156,7 @@
         FROM application.bytedance_advertiser_report_hourly_dw
         WHERE stat_datetime >= DATE_FORMAT(#{startTime}, '%Y%m%d')
         and stat_datetime &lt;= DATE_FORMAT(#{endTime}, '%Y%m%d')
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -171,6 +174,7 @@
         WHERE
         stat_date >= DATE_FORMAT(#{startTime}, '%Y%m%d')
         and stat_date &lt;= DATE_FORMAT(#{endTime}, '%Y%m%d')
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -188,6 +192,7 @@
         WHERE
         stat_date >= DATE_FORMAT(#{startDay}, '%Y%m%d')
         and stat_date &lt;= DATE_FORMAT(#{endDay}, '%Y%m%d')
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -210,6 +215,7 @@
         application.app_kuaishou_agent_report_d
         WHERE stat_date >= DATE_FORMAT( #{monthFirstday}, '%Y%m%d' )
         AND stat_date &lt;= DATE_FORMAT( #{statDay}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -225,6 +231,7 @@
         application.app_kuaishou_agent_report_d
         WHERE stat_date >= DATE_FORMAT(#{lastMonthFirstday}, '%Y%m%d' )
         AND stat_date &lt; DATE_FORMAT(#{monthFirstday}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND
             account_id IN
@@ -249,6 +256,7 @@
         application.app_bytedance_agent_report_d
         WHERE stat_datetime >= DATE_FORMAT( #{monthFirstday}, '%Y%m%d' )
         AND stat_datetime &lt;= DATE_FORMAT( #{statDay}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND
             account_id IN
@@ -321,6 +329,7 @@
         SELECT hour,sum(charge) as 'charge'
         FROM application.kuaishou_account_report_hourly_dw
         WHERE stat_date = DATE_FORMAT(#{statDay}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -336,6 +345,7 @@
         SELECT hour,sum(cost) as 'charge'
         FROM application.bytedance_advertiser_report_hourly_dw
         WHERE stat_datetime = DATE_FORMAT(#{statDay}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -361,6 +371,7 @@
         application.bytedance_advertiser_report_hourly_dw
         WHERE stat_datetime >= DATE_FORMAT(#{startTime}, '%Y%m%d' )
         AND stat_datetime &lt;= DATE_FORMAT(#{endTime}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -376,6 +387,7 @@
         application.bytedance_advertiser_report_hourly_dw
         WHERE stat_datetime >= DATE_FORMAT( #{lastTimeStart}, '%Y%m%d' )
         AND stat_datetime &lt;= DATE_FORMAT( #{lastTimeEnd}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -400,6 +412,7 @@
         application.kuaishou_account_report_hourly_dw
         WHERE stat_date >= DATE_FORMAT(#{startTime}, '%Y%m%d' )
         AND stat_date &lt;= DATE_FORMAT(#{endTime}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -415,6 +428,7 @@
         application.kuaishou_account_report_hourly_dw
         WHERE stat_date >= DATE_FORMAT( #{lastTimeStart}, '%Y%m%d' )
         AND stat_date &lt;= DATE_FORMAT( #{lastTimeEnd}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             AND account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -432,6 +446,7 @@
         (select 1 from application.kuaishou_account_report_hourly_dw t1
         where t1.stat_date >= DATE_FORMAT(#{startTime}, '%Y%m%d')
         and t1.stat_date &lt;= DATE_FORMAT(#{endTime}, '%Y%m%d')
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -449,6 +464,7 @@
         (select 1 from application.bytedance_advertiser_report_hourly_dw t1
         where t1.stat_datetime >= DATE_FORMAT(#{startTime}, '%Y%m%d')
         and t1.stat_datetime &lt;= DATE_FORMAT(#{endTime}, '%Y%m%d')
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -480,6 +496,7 @@
         FROM application.app_kuaishou_agent_report_d
         WHERE stat_date >= DATE_FORMAT(#{startTime}, '%Y%m%d' )
         AND stat_date &lt;= DATE_FORMAT(#{endTime}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -492,6 +509,7 @@
         LEFT JOIN (
         SELECT project_id, SUM( charge ) AS 'charge' FROM application.kuaishou_account_report_hourly_dw
         WHERE hour &lt;= #{hour}
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -504,6 +522,7 @@
         GROUP BY project_id ) t3 ON t1.project_id = t3.project_id
         left join(select id,realname from `jeecg-boot`.sys_user )t4 on t1.sale_id=t4.id
         WHERE hour &lt;= #{hour}
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and t1.account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -537,6 +556,7 @@
         FROM application.app_bytedance_agent_report_d
         WHERE stat_datetime >= DATE_FORMAT(#{startTime}, '%Y%m%d' )
         AND stat_datetime &lt;= DATE_FORMAT(#{endTime}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -550,6 +570,7 @@
         SELECT project_id, SUM( cost ) AS 'charge' FROM application.bytedance_advertiser_report_hourly_dw
         WHERE stat_datetime >= DATE_FORMAT(DATE_ADD(#{startTime}, INTERVAL - ${days} DAY ), '%Y%m%d' )
         AND stat_datetime &lt;= DATE_FORMAT(DATE_ADD(#{endTime}, INTERVAL - ${days} DAY ), '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id IN
             <foreach collection="accountIds" item="id" separator=","
@@ -562,6 +583,7 @@
         left join(select id,realname from `jeecg-boot`.sys_user )t4 on t1.sale_id=t4.id
         WHERE t1.stat_datetime >= DATE_FORMAT(#{startTime}, '%Y%m%d' )
         AND t1.stat_datetime &lt;= DATE_FORMAT(#{endTime}, '%Y%m%d' )
+        and company_id = #{companyId}
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id IN
             <foreach collection="accountIds" item="id" separator=","

+ 31 - 31
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/ManagerSaleValueServiceImpl.java

@@ -124,27 +124,27 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
         //1 头条
         if ("1".equals(mediaId)) {
             //查询当日消耗 + 环比
-            result = baseMapper.queryTtTodayCharge(statDay, hour, accountIds);
+            result = baseMapper.queryTtTodayCharge(statDay, hour, accountIds, companyId);
             //周消耗
-            weekCharge = baseMapper.queryTtManydaysTotalCharge(weekFirstDay, statDay, accountIds);
+            weekCharge = baseMapper.queryTtManydaysTotalCharge(weekFirstDay, statDay, accountIds, companyId);
             //月消耗
-            String monthCharge = baseMapper.queryTtManydaysTotalCharge(monthFirstday, statDay, accountIds);
+            String monthCharge = baseMapper.queryTtManydaysTotalCharge(monthFirstday, statDay, accountIds, companyId);
             result.put("weekCharge", new BigDecimal(weekCharge));
             result.put("monthCharge", new BigDecimal(monthCharge));
             //现金消耗 + 环比ROI
-            JSONObject realCharged = baseMapper.queryTtRealCharged(lastMonthFirstday, monthFirstday, statDay, accountIds);
+            JSONObject realCharged = baseMapper.queryTtRealCharged(lastMonthFirstday, monthFirstday, statDay, accountIds, companyId);
             result.put("realCharged", realCharged.getBigDecimal("realCharged"));
             result.put("realChargedRoi", realCharged.getString("realChargedRoi"));
         } else if ("2".equals(mediaId)) {
-            result = baseMapper.queryKsTodayCharge(statDay, hour, accountIds);
+            result = baseMapper.queryKsTodayCharge(statDay, hour, accountIds, companyId);
             //周消耗
-            weekCharge = baseMapper.queryKsManydaysTotalCharge(weekFirstDay, statDay, accountIds);
+            weekCharge = baseMapper.queryKsManydaysTotalCharge(weekFirstDay, statDay, accountIds, companyId);
             //月消耗
-            String monthCharge = baseMapper.queryKsManydaysTotalCharge(monthFirstday, statDay, accountIds);
+            String monthCharge = baseMapper.queryKsManydaysTotalCharge(monthFirstday, statDay, accountIds, companyId);
             result.put("weekCharge", new BigDecimal(weekCharge));
             result.put("monthCharge", new BigDecimal(monthCharge));
             //现金消耗 + 环比ROI
-            JSONObject realCharged = baseMapper.queryKsRealCharged(lastMonthFirstday, monthFirstday, statDay, accountIds);
+            JSONObject realCharged = baseMapper.queryKsRealCharged(lastMonthFirstday, monthFirstday, statDay, accountIds, companyId);
             result.put("realCharged", realCharged.getBigDecimal("realCharged"));
             result.put("realChargedRoi", realCharged.getString("realChargedRoi"));
         }
@@ -243,28 +243,28 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
         //1 头条
         if ("1".equals(mediaId)) {
             //查询 消耗 + 环比
-            result = baseMapper.queryTtManydaysChargeAndRoi(startTime, endTime, lastTimeStart, lastTimeEnd, accountIds);
-            List<JSONObject> list = baseMapper.queryTtManydaysCharge(startTime, endTime, accountIds);
+            result = baseMapper.queryTtManydaysChargeAndRoi(startTime, endTime, lastTimeStart, lastTimeEnd, accountIds, companyId);
+            List<JSONObject> list = baseMapper.queryTtManydaysCharge(startTime, endTime, accountIds, companyId);
             result.put("list", list);
             //平台消耗
             if (compayAllAccountIds == null) {
                 result.put("platformCharge", result.getString("totalCharge"));
                 result.put("platformChargeRoi", result.getString("chargeRoi"));
             } else {
-                JSONObject ptdata = baseMapper.queryTtManydaysChargeAndRoi(startTime, endTime, lastTimeStart, lastTimeEnd, compayAllAccountIds);
+                JSONObject ptdata = baseMapper.queryTtManydaysChargeAndRoi(startTime, endTime, lastTimeStart, lastTimeEnd, compayAllAccountIds, companyId);
                 result.put("platformCharge", ptdata.getString("totalCharge"));
                 result.put("platformChargeRoi", ptdata.getString("chargeRoi"));
             }
         } else if ("2".equals(mediaId)) {
-            result = baseMapper.queryKsManydaysChargeAndRoi(startTime, endTime, lastTimeStart, lastTimeEnd, accountIds);
-            List<JSONObject> list = baseMapper.queryKsManydaysCharge(startTime, endTime, accountIds);
+            result = baseMapper.queryKsManydaysChargeAndRoi(startTime, endTime, lastTimeStart, lastTimeEnd, accountIds, companyId);
+            List<JSONObject> list = baseMapper.queryKsManydaysCharge(startTime, endTime, accountIds, companyId);
             result.put("list", list);
             //平台消耗
             if (compayAllAccountIds == null) {
                 result.put("platformCharge", result.getString("totalCharge"));
                 result.put("platformChargeRoi", result.getString("chargeRoi"));
             } else {
-                JSONObject ptdata = baseMapper.queryKsManydaysChargeAndRoi(startTime, endTime, lastTimeStart, lastTimeEnd, compayAllAccountIds);
+                JSONObject ptdata = baseMapper.queryKsManydaysChargeAndRoi(startTime, endTime, lastTimeStart, lastTimeEnd, compayAllAccountIds, companyId);
                 result.put("platformCharge", ptdata.getString("totalCharge"));
                 result.put("platformChargeRoi", ptdata.getString("chargeRoi"));
             }
@@ -283,28 +283,28 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
         //1 头条
         if ("1".equals(mediaId)) {
             //查询当日消耗 + 环比
-            result = baseMapper.queryTtTodayCharge(date, hour, accountIds);
-            List<JSONObject> list = baseMapper.queryTtHourList(date, accountIds);
+            result = baseMapper.queryTtTodayCharge(date, hour, accountIds, companyId);
+            List<JSONObject> list = baseMapper.queryTtHourList(date, accountIds, companyId);
             result.put("list", list);
             //平台消耗
             if (compayAllAccountIds == null) {
                 result.put("platformCharge", result.getString("totalCharge"));
                 result.put("platformChargeRoi", result.getString("chargeRoi"));
             } else {
-                JSONObject ptdata = baseMapper.queryTtTodayCharge(date, hour, compayAllAccountIds);
+                JSONObject ptdata = baseMapper.queryTtTodayCharge(date, hour, compayAllAccountIds, companyId);
                 result.put("platformCharge", ptdata.getString("totalCharge"));
                 result.put("platformChargeRoi", ptdata.getString("chargeRoi"));
             }
         } else if ("2".equals(mediaId)) {
-            result = baseMapper.queryKsTodayCharge(date, hour, accountIds);
-            List<JSONObject> list = baseMapper.queryKsHourList(date, accountIds);
+            result = baseMapper.queryKsTodayCharge(date, hour, accountIds, companyId);
+            List<JSONObject> list = baseMapper.queryKsHourList(date, accountIds, companyId);
             result.put("list", list);
             //平台消耗
             if (compayAllAccountIds == null) {
                 result.put("platformCharge", result.getString("totalCharge"));
                 result.put("platformChargeRoi", result.getString("chargeRoi"));
             } else {
-                JSONObject ptdata = baseMapper.queryKsTodayCharge(date, hour, compayAllAccountIds);
+                JSONObject ptdata = baseMapper.queryKsTodayCharge(date, hour, compayAllAccountIds, companyId);
                 result.put("platformCharge", ptdata.getString("totalCharge"));
                 result.put("platformChargeRoi", ptdata.getString("chargeRoi"));
             }
@@ -326,9 +326,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
                     throw new Exception("未查询到账户!");
                 }
                 if (startTime.equals(endTime)) {
-                    return getProjectDailyCharges(accountIds, mediaId, startTime, null, pageNo, pageSize);
+                    return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, null, pageNo, pageSize);
                 } else {
-                    return getProjectDailyCharges(accountIds, mediaId, startTime, endTime, pageNo, pageSize);
+                    return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, endTime, pageNo, pageSize);
                 }
             }
 
@@ -341,9 +341,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
                 throw new Exception("未查询到账户!");
             }
             if (startTime.equals(endTime)) {
-                return getProjectDailyCharges(accountIds, mediaId, startTime, null, pageNo, pageSize);
+                return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, null, pageNo, pageSize);
             } else {
-                return getProjectDailyCharges(accountIds, mediaId, startTime, endTime, pageNo, pageSize);
+                return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, endTime, pageNo, pageSize);
             }
             //分公司总经理
         } else if ("CompanyManager".equals(roleCode) || "admin".equals(roleCode)) {
@@ -353,16 +353,16 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
                 throw new Exception("未查询到账户!");
             }
             if (startTime.equals(endTime)) {
-                return getProjectDailyCharges(accountIds, mediaId, startTime, null, pageNo, pageSize);
+                return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, null, pageNo, pageSize);
             } else {
-                return getProjectDailyCharges(accountIds, mediaId, startTime, endTime, pageNo, pageSize);
+                return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, endTime, pageNo, pageSize);
             }
         } else {
             throw new Exception("该用户角色权限不足!");
         }
     }
 
-    private PageInfo getProjectDailyCharges(List<Long> accountIds, String mediaId, String startTime, String endTime, Integer pageNo, Integer pageSize) throws ParseException {
+    private PageInfo getProjectDailyCharges(List<Long> accountIds, String companyId, String mediaId, String startTime, String endTime, Integer pageNo, Integer pageSize) throws ParseException {
         Long days = 1L;
         Integer hour = DateUtils.getHour(DateUtils.formatDateTime());
         if (endTime == null) {
@@ -373,16 +373,16 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
         }
         //1 头条
         if ("1".equals(mediaId)) {
-            Long total = baseMapper.queryTtHourProjectTopTotal(accountIds, startTime, endTime);
+            Long total = baseMapper.queryTtHourProjectTopTotal(accountIds, startTime, endTime, companyId);
             PageHelper.startPage(pageNo, pageSize, false);
-            List<JSONObject> list = baseMapper.queryTtHourProjectTop(accountIds, startTime, endTime, days, hour);
+            List<JSONObject> list = baseMapper.queryTtHourProjectTop(accountIds, startTime, endTime, days, hour, companyId);
             PageInfo pageInfo = new PageInfo(list);
             pageInfo.setTotal(total);
             return pageInfo;
         } else if ("2".equals(mediaId)) {
-            Long total = baseMapper.queryKsHourProjectTopTotal(accountIds, startTime, endTime);
+            Long total = baseMapper.queryKsHourProjectTopTotal(accountIds, startTime, endTime, companyId);
             PageHelper.startPage(pageNo, pageSize, false);
-            List<JSONObject> list = baseMapper.queryKsHourProjectTop(accountIds, startTime, endTime, days, hour);
+            List<JSONObject> list = baseMapper.queryKsHourProjectTop(accountIds, startTime, endTime, days, hour, companyId);
             PageInfo pageInfo = new PageInfo(list);
             pageInfo.setTotal(total);
             return pageInfo;