Pārlūkot izejas kodu

重构用餐报表

王先生 2 gadi atpakaļ
vecāks
revīzija
fd66a86067

+ 32 - 32
eladmin-system/src/main/java/me/zhengjie/modules/dm/statement/repository/DmHaveDinnerRepository.java

@@ -292,7 +292,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      */
     @Modifying
     @Transactional
-    @Query(nativeQuery = true,value = "create view `DAY_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
+    @Query(nativeQuery = true,value = "create view `DAY_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
     void createDayDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
 
     /**
@@ -303,7 +303,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      */
     @Modifying
     @Transactional
-    @Query(nativeQuery = true,value = "create view `DAY_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
+    @Query(nativeQuery = true,value = "create view `DAY_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
     void createDayDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
 
     /**
@@ -314,7 +314,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      */
     @Modifying
     @Transactional
-    @Query(nativeQuery = true,value = "create view `WEEK_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
+    @Query(nativeQuery = true,value = "create view `WEEK_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
     void createWeekDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
 
     /**
@@ -325,7 +325,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      */
     @Modifying
     @Transactional
-    @Query(nativeQuery = true,value = "create view `WEEK_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
+    @Query(nativeQuery = true,value = "create view `WEEK_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
     void createWeekDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
 
     /**
@@ -336,7 +336,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      */
     @Modifying
     @Transactional
-    @Query(nativeQuery = true,value = "create view `MONTH_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
+    @Query(nativeQuery = true,value = "create view `MONTH_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
     void createMonthDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
 
     /**
@@ -347,7 +347,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      */
     @Modifying
     @Transactional
-    @Query(nativeQuery = true,value = "create view `MONTH_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
+    @Query(nativeQuery = true,value = "create view `MONTH_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
     void createMonthDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
 
     /**
@@ -358,7 +358,7 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      */
     @Modifying
     @Transactional
-    @Query(nativeQuery = true,value = "create view `YEAR_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
+    @Query(nativeQuery = true,value = "create view `YEAR_DINING_STATEMENTS_TOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid desc LIMIT 0,3 ")
     void createYearDiningStatementsTopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
 
     /**
@@ -369,24 +369,24 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      */
     @Modifying
     @Transactional
-    @Query(nativeQuery = true,value = "create view `YEAR_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,item.price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
+    @Query(nativeQuery = true,value = "create view `YEAR_DINING_STATEMENTS_STOP` as SELECT item.pid,item.name,COUNT(item.pid) as countPid,sum(item.price) as price,rec.create_date,item.seq FROM dm_order_record rec LEFT JOIN  dm_order_item item on rec.seq = item.seq WHERE item.pid is not NULL and rec.create_date BETWEEN ?1  AND ?2  GROUP BY item.pid ORDER BY countPid ASC LIMIT 0,3 ")
     void createYearDiningStatementsStopThreeView(@Param("startTime") String startTime,@Param("nowTime") String nowTime,@Param("viewName") String viewName);
 
     /**
      * 查询前三日报
      * @return
      */
-    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `DAY_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ",
-    countQuery = "SELECT count(1) FROM `DAY_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ")
-    List<Map<String,Object>> selectDayTopView(String startTime, String nowTime,Pageable pageable);
+    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `DAY_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ",
+    countQuery = "SELECT count(1) FROM `DAY_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ")
+    Page<List<Map<String,Object>>> selectDayTopView(String startTime, String nowTime,Pageable pageable);
 
     /**
      * 查询后三日报
      * @return
      */
-    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `DAY_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2",
-    countQuery = "SELECT count(1) FROM `DAY_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2")
-    List<Map<String,Object>> selectDayStopView(String startTime, String nowTime,Pageable pageable);
+    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `DAY_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
+    countQuery = "SELECT count(1) FROM `DAY_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)")
+    Page<List<Map<String,Object>>> selectDayStopView(String startTime, String nowTime,Pageable pageable);
 
     /**
      * 查询前三周报
@@ -396,9 +396,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      * @param pageable
      * @return
      */
-    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `WEEK_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ",
-    countQuery = "SELECT count(1) FROM `WEEK_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ")
-    List<Map<String,Object>> selectWeekTopView(String startTime, String nowTime, Pageable pageable);
+    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `WEEK_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ",
+    countQuery = "SELECT count(1) FROM `WEEK_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ")
+    Page<List<Map<String,Object>>> selectWeekTopView(String startTime, String nowTime, Pageable pageable);
 
     /**
      * 查询后三周报
@@ -408,9 +408,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      * @param pageable
      * @return
      */
-    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `WEEK_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2 ",
-    countQuery = "SELECT count(1) FROM `WEEK_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2 ")
-    List<Map<String,Object>> selectWeekStopView(String startTime, String nowTime, Pageable pageable);
+    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `WEEK_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ",
+    countQuery = "SELECT count(1) FROM `WEEK_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ")
+    Page<List<Map<String,Object>>> selectWeekStopView(String startTime, String nowTime, Pageable pageable);
 
     /**
      * 查询前三 月报
@@ -420,9 +420,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      * @param pageable
      * @return
      */
-    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2",
-    countQuery = "SELECT count(1) FROM `MONTH_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ")
-    List<Map<String,Object>> selectMonthTopView(String startTime, String nowTime, Pageable pageable);
+    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
+    countQuery = "SELECT count(1) FROM `MONTH_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)")
+    Page<List<Map<String,Object>>> selectMonthTopView(String startTime, String nowTime, Pageable pageable);
 
     /**
      * 查询后三 月报
@@ -432,9 +432,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      * @param pageable
      * @return
      */
-    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2",
-    countQuery = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2")
-    List<Map<String,Object>> selectMonthStopView(String startTime, String nowTime, Pageable pageable);
+    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
+    countQuery = "SELECT pid,name,countPid,price,create_date FROM `MONTH_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)")
+    Page<List<Map<String,Object>>> selectMonthStopView(String startTime, String nowTime, Pageable pageable);
 
     /**
      * 查询前三 年报
@@ -444,9 +444,9 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      * @param pageable
      * @return
      */
-    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `YEAR_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2",
-    countQuery = "SELECT count(1) FROM `YEAR_DINING_STATEMENTS_TOP` where create_date between ?1 and ?2 ")
-    List<Map<String,Object>> selectYearTopView(String startTime, String nowTime, Pageable pageable);
+    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `YEAR_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
+    countQuery = "SELECT count(1) FROM `YEAR_DINING_STATEMENTS_TOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2) ")
+    Page<List<Map<String,Object>>> selectYearTopView(String startTime, String nowTime, Pageable pageable);
 
     /**
      * 查询后三 年报
@@ -456,8 +456,8 @@ public interface DmHaveDinnerRepository extends JpaRepository<DmHaveDinner,Integ
      * @param pageable
      * @return
      */
-    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `YEAR_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2",
-    countQuery = "SELECT count(1) FROM `YEAR_DINING_STATEMENTS_STOP` where create_date between ?1 and ?2")
-    List<Map<String,Object>> selectYearStopView(String startTime, String nowTime, Pageable pageable);
+    @Query(nativeQuery = true,value = "SELECT pid,name,countPid,price,create_date FROM `YEAR_DINING_STATEMENTS_STOP` where IF(?1 is null || '' = ?1,1=1,create_date between ?1 and ?2)",
+    countQuery = "SELECT count(1) FROM `YEAR_DINING_STATEMENTS_STOP` where IF(?1 is null || ''= ?1,1=1,create_date between ?1 and ?2)")
+    Page<List<Map<String,Object>>> selectYearStopView(String startTime, String nowTime, Pageable pageable);
 
 }

+ 2 - 2
eladmin-system/src/main/java/me/zhengjie/modules/dm/statement/rest/DmHaveDinnerController.java

@@ -1,5 +1,6 @@
 package me.zhengjie.modules.dm.statement.rest;
 
+import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
@@ -53,8 +54,7 @@ public class DmHaveDinnerController {
     @ApiOperation("用餐报表")
 //    @PreAuthorize("@el.check('dmHaveDinner:list')")
     public ResponseEntity<Object> selectZgHaveDinner(String stateDate, String endDate, String type, Pageable pageable){
-        Map<String,Object> map = new HashMap<>();
-        map.put("one",dmHaveDinnerService.selectZgHaveDinner(stateDate,endDate,type,pageable));
+        JSONObject map = dmHaveDinnerService.selectDiningStatements(stateDate,endDate,type,pageable);
         return new ResponseEntity<>(map, HttpStatus.OK);
     }
 

+ 3 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/statement/service/DmHaveDinnerService.java

@@ -1,5 +1,6 @@
 package me.zhengjie.modules.dm.statement.service;
 
+import com.alibaba.fastjson.JSONObject;
 import me.zhengjie.modules.dm.statement.service.dto.DmHaveDinnerDto;
 import org.springframework.data.domain.Pageable;
 
@@ -43,4 +44,6 @@ public interface DmHaveDinnerService {
      * @throws IOException /
      */
     void downWeekload(List<DmHaveDinnerDto> all, HttpServletResponse response) throws IOException;
+
+    JSONObject selectDiningStatements(String stateDate, String endDate, String type, Pageable pageable);
 }

+ 40 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/statement/service/impl/DmHaveDinnerServiceImpl.java

@@ -1,5 +1,6 @@
 package me.zhengjie.modules.dm.statement.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.zaxxer.hikari.HikariDataSource;
 import lombok.RequiredArgsConstructor;
 import me.zhengjie.modules.dm.statement.domain.DmHaveDinner;
@@ -31,6 +32,43 @@ public class DmHaveDinnerServiceImpl implements DmHaveDinnerService {
     private final DmHaveDinnerMapper dmHaveDinnerMapper;
     private final DmHaveDinnerRepository dmHaveDinnerRepository;
 
+    @Override
+    public JSONObject selectDiningStatements(String stateDate, String endDate, String type, Pageable pageable) {
+       // 前三
+        Page<List<Map<String, Object>>> top = null;
+       // 后三
+        Page<List<Map<String, Object>>> stop = null;
+        // 默认按月来
+        if (type == null){
+            top = dmHaveDinnerRepository.selectMonthTopView(stateDate,endDate,pageable);
+            stop = dmHaveDinnerRepository.selectMonthStopView(stateDate, endDate, pageable);
+        }
+        //按日报来
+        if (type.equals("day")){
+            top = dmHaveDinnerRepository.selectDayTopView(stateDate,endDate,pageable);
+            stop = dmHaveDinnerRepository.selectDayStopView(stateDate, endDate, pageable);
+        }
+        // 按周报来
+        if (type.equals("week")){
+            top = dmHaveDinnerRepository.selectWeekTopView(stateDate,endDate,pageable);
+            stop = dmHaveDinnerRepository.selectWeekStopView(stateDate, endDate, pageable);
+        }
+        // 按月报来
+        if (type.equals("month")){
+            top = dmHaveDinnerRepository.selectMonthTopView(stateDate,endDate,pageable);
+            stop = dmHaveDinnerRepository.selectMonthStopView(stateDate, endDate, pageable);
+        }
+        // 按年报来
+        if (type.equals("year")){
+            top = dmHaveDinnerRepository.selectYearTopView(stateDate,endDate,pageable);
+            stop = dmHaveDinnerRepository.selectYearStopView(stateDate, endDate, pageable);
+        }
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("top", PageUtil.toPage(top));
+        jsonObject.put("stop", PageUtil.toPage(stop));
+        return jsonObject;
+    }
+
     @Override
     public Map<String, Object> selectZgHaveDinner(String stateDate, String endDate, String type, Pageable pageable) {
         Page<DmHaveDinner> page = null;
@@ -188,4 +226,6 @@ public class DmHaveDinnerServiceImpl implements DmHaveDinnerService {
         }
         FileUtil.downloadExcel(list, response);
     }
+
+
 }

+ 7 - 6
eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/DiningStatementsTask.java

@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
 import me.zhengjie.modules.dm.statement.repository.DmHaveDinnerRepository;
 import me.zhengjie.modules.dm.statement.service.mapstruct.DmHaveDinnerMapper;
 import me.zhengjie.utils.StringUtils;
+import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.domain.Sort;
 import org.springframework.stereotype.Component;
@@ -132,7 +133,7 @@ public class DiningStatementsTask {
         String viewTopName = dmHaveDinnerRepository.judgeView("WEEK_DINING_STATEMENTS_TOP");
         if (!StringUtils.isEmpty(viewTopName)){
             //查询视图
-            List<Map<String, Object>> maps = dmHaveDinnerRepository.selectWeekTopView(startTime, nowTime, null);
+            Page<List<Map<String, Object>>> maps = dmHaveDinnerRepository.selectWeekTopView(startTime, nowTime, null);
             if (ObjectUtil.isEmpty(maps)){
                 //删除视图
                 dmHaveDinnerRepository.dropWeekTopView("WEEK_DINING_STATEMENTS_TOP");
@@ -152,7 +153,7 @@ public class DiningStatementsTask {
         //由于是一周一生成 那就再新增之前就要删除之前的视图
         if (!StringUtils.isEmpty(viewStopName)){
             //查询视图
-            List<Map<String, Object>> maps = dmHaveDinnerRepository.selectWeekStopView(startTime, nowTime, null);
+            Page<List<Map<String, Object>>> maps = dmHaveDinnerRepository.selectWeekStopView(startTime, nowTime, null);
              if (ObjectUtil.isEmpty(maps)){
                  //删除视图
                  dmHaveDinnerRepository.dropWeekTopView("WEEK_DINING_STATEMENTS_STOP");
@@ -187,7 +188,7 @@ public class DiningStatementsTask {
         String viewTopName = dmHaveDinnerRepository.judgeView("MONTH_DINING_STATEMENTS_TOP");
         if (!StringUtils.isEmpty(viewTopName)){
             //查询视图
-            List<Map<String, Object>> maps = dmHaveDinnerRepository.selectMonthTopView(startTime, nowTime, null);
+            Page<List<Map<String, Object>>> maps = dmHaveDinnerRepository.selectMonthTopView(startTime, nowTime, null);
             if (ObjectUtil.isEmpty(maps)){
                 //删除视图
                 dmHaveDinnerRepository.dropWeekTopView("MONTH_DINING_STATEMENTS_TOP");
@@ -207,7 +208,7 @@ public class DiningStatementsTask {
         //由于是一周一生成 那就再新增之前就要删除之前的视图
         if (!StringUtils.isEmpty(viewStopName)){
             //查询视图
-            List<Map<String, Object>> maps = dmHaveDinnerRepository.selectWeekStopView(startTime, nowTime, null);
+            Page<List<Map<String, Object>>> maps = dmHaveDinnerRepository.selectWeekStopView(startTime, nowTime, null);
             if (ObjectUtil.isEmpty(maps)){
                 //删除视图
                 dmHaveDinnerRepository.dropMonthTopView("MONTH_DINING_STATEMENTS_STOP");
@@ -241,7 +242,7 @@ public class DiningStatementsTask {
         String viewTopName = dmHaveDinnerRepository.judgeView("YEAR_DINING_STATEMENTS_TOP");
         if (!StringUtils.isEmpty(viewTopName)){
             //查询视图
-            List<Map<String, Object>> maps = dmHaveDinnerRepository.selectYearTopView(startTime, nowTime, null);
+            Page<List<Map<String, Object>>> maps = dmHaveDinnerRepository.selectYearTopView(startTime, nowTime, null);
             if (ObjectUtil.isEmpty(maps)){
                 //删除视图
                 dmHaveDinnerRepository.dropYearTopView("YEAR_DINING_STATEMENTS_TOP");
@@ -261,7 +262,7 @@ public class DiningStatementsTask {
         //由于是一周一生成 那就再新增之前就要删除之前的视图
         if (!StringUtils.isEmpty(viewStopName)){
             //查询视图
-            List<Map<String, Object>> maps = dmHaveDinnerRepository.selectYearStopView(startTime, nowTime, null);
+            Page<List<Map<String, Object>>> maps = dmHaveDinnerRepository.selectYearStopView(startTime, nowTime, null);
             if (ObjectUtil.isEmpty(maps)){
                 //删除视图
                 dmHaveDinnerRepository.dropYearStopView("YEAR_DINING_STATEMENTS_STOP");