use of com.itrus.portal.db.MakeSealServerExample in project portal by ixinportal.
the class MakeSealServerController method list.
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) {
// page,size
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
Integer count = makeSealServerService.selectCount(null);
uiModel.addAttribute("count", count);
uiModel.addAttribute("pages", (count + size - 1) / size);
// page, size
if (page > 1 && size * (page - 1) >= count) {
page = (count + size - 1) / size;
}
uiModel.addAttribute("page", page);
uiModel.addAttribute("size", size);
Integer offset = size * (page - 1);
MakeSealServerExample mssExample = new MakeSealServerExample();
mssExample.setOffset(offset);
mssExample.setLimit(size);
List<MakeSealServer> makeSealServers = makeSealServerService.selectMakeSealServers(mssExample);
uiModel.addAttribute("makeSealServers", makeSealServers);
uiModel.addAttribute("itemcount", makeSealServers.size());
return "makesealserver/list";
}
Aggregations