|
@@ -580,44 +580,24 @@ public class ProjectAlarmRuleServiceImpl extends ServiceImpl<ProjectAlarmRuleMap
|
|
|
*/
|
|
|
@Override
|
|
|
public List<ProjectAlarmRuleListItemVO> pageBySubList(List<ProjectAlarmRuleListItemVO> list, int pagesize, int currentPage) {
|
|
|
-
|
|
|
int totalcount = list.size();
|
|
|
-
|
|
|
int pagecount = 0;
|
|
|
-
|
|
|
List<ProjectAlarmRuleListItemVO> subList;
|
|
|
-
|
|
|
int m = totalcount % pagesize;
|
|
|
-
|
|
|
if (m > 0) {
|
|
|
-
|
|
|
pagecount = totalcount / pagesize + 1;
|
|
|
-
|
|
|
} else {
|
|
|
-
|
|
|
pagecount = totalcount / pagesize;
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
if (m == 0) {
|
|
|
-
|
|
|
subList = list.subList((currentPage - 1) * pagesize, pagesize * (currentPage));
|
|
|
-
|
|
|
} else {
|
|
|
-
|
|
|
if (currentPage == pagecount) {
|
|
|
-
|
|
|
subList = list.subList((currentPage - 1) * pagesize, totalcount);
|
|
|
-
|
|
|
} else {
|
|
|
-
|
|
|
subList = list.subList((currentPage - 1) * pagesize, pagesize * (currentPage));
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
return subList;
|
|
|
-
|
|
|
}
|
|
|
}
|