Преглед изворни кода

系统日志查询还原日志查询

lengfaqiang пре 2 година
родитељ
комит
d2a08f901f

+ 1 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsAlarmMapper.java

@@ -53,4 +53,5 @@ public interface KwsAlarmMapper extends BaseMapper<KwsAlarm> {
 
     List<AlarmLogThresholdVO> selectDetailList(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
 
+    int  selectDetailCount();
 }

+ 6 - 7
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/KwsAlarmService.java

@@ -104,13 +104,12 @@ public class KwsAlarmService {
 //                list.add(vo);
             }
         }
-        List<AlarmLogThresholdVO> list1 = alarmMapper.selectDetailList(null, null);
-        int count = CollectionUtils.isEmpty(list1) ? 0 : list1.size();
-        info.setPageNum(query.getPage());
-        info.setPageSize(query.getPageSize());
-        info.setTotal(CollectionUtils.isEmpty(list1) ? 0 : list1.size());
-        int totalPages = (int) Math.ceil((double) count / query.getPageSize());
-        info.setPages(totalPages);
+//        int count= alarmMapper.selectDetailCount();
+//        info.setPageNum(query.getPage());
+//        info.setPageSize(query.getPageSize());
+//        info.setTotal(count);
+//        int totalPages = (int) Math.ceil((double) count / query.getPageSize());
+//        info.setPages(totalPages);
         return PageRes.build(info, list);
     }
 

+ 7 - 3
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsAlarmMapper.xml

@@ -339,8 +339,12 @@
         WHERE a.mountain_id = b.mountain_id
           and b.`status` = 0
         ORDER BY a.create_time DESC
-        <if test="page != null and pageSize !=null ">
-            limit #{page} , #{pageSize}
-        </if>
+<!--        <if test="page != null and pageSize !=null ">-->
+<!--            limit #{page} , #{pageSize}-->
+<!--        </if>-->
+    </select>
+
+    <select id="selectDetailCount" resultType="int">
+
     </select>
 </mapper>