Commit 01317c76 authored by 朱晨阳's avatar 朱晨阳

添加分页

parent b017bf4e
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
</where> </where>
ORDER BY ORDER BY
log.CREATE_DATE DESC log.CREATE_DATE DESC
LIMIT #{start}, #{offset} LIMIT #{start}, #{size}
</select> </select>
<select id="queryWarningCount" resultType="java.lang.Long"> <select id="queryWarningCount" resultType="java.lang.Long">
......
...@@ -36,7 +36,7 @@ public interface McbWarningMapper extends BaseMapper { ...@@ -36,7 +36,7 @@ public interface McbWarningMapper extends BaseMapper {
*/ */
List<Map<String, Object>> queryWarningList( List<Map<String, Object>> queryWarningList(
@Param("start") Long start, @Param("start") Long start,
@Param("offset") Long offset, @Param("size") Long size,
@Param("projectOrgCodes") List<String> projectOrgCodes, @Param("projectOrgCodes") List<String> projectOrgCodes,
@Param("processingStatus") Integer processingStatus, @Param("processingStatus") Integer processingStatus,
@Param("eventLevel") String eventLevel, @Param("eventLevel") String eventLevel,
......
...@@ -77,12 +77,12 @@ public class McbWarningServiceImpl implements IMcbWarningService { ...@@ -77,12 +77,12 @@ public class McbWarningServiceImpl implements IMcbWarningService {
public Page<Map<String, Object>> queryWarningPage(Page<Map<String, Object>> page, Integer processingStatus, public Page<Map<String, Object>> queryWarningPage(Page<Map<String, Object>> page, Integer processingStatus,
String eventLevel, String createDate,String startTime,String endTime, String warningSourceType,String objectName, String overView) { String eventLevel, String createDate,String startTime,String endTime, String warningSourceType,String objectName, String overView) {
List<String> projectOrgCodes = this.getProjectOrgCodes(); List<String> projectOrgCodes = this.getProjectOrgCodes();
long start = page.getCurrent() - 1; long start = (page.getCurrent() - 1) * page.getSize();
long offset = page.getSize() * page.getCurrent(); long size = page.getSize();
if (projectOrgCodes.isEmpty()) { if (projectOrgCodes.isEmpty()) {
projectOrgCodes.add("NULL"); projectOrgCodes.add("NULL");
} }
List<Map<String, Object>> records = mcbWarningMapper.queryWarningList(start, offset, projectOrgCodes, List<Map<String, Object>> records = mcbWarningMapper.queryWarningList(start, size, projectOrgCodes,
processingStatus, eventLevel, createDate,startTime,endTime, warningSourceType,objectName, overView); processingStatus, eventLevel, createDate,startTime,endTime, warningSourceType,objectName, overView);
Long total = mcbWarningMapper.queryWarningCount(projectOrgCodes, processingStatus, eventLevel, createDate,startTime,endTime, Long total = mcbWarningMapper.queryWarningCount(projectOrgCodes, processingStatus, eventLevel, createDate,startTime,endTime,
warningSourceType,objectName, overView); warningSourceType,objectName, overView);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment