use of com.itrus.portal.db.ExtraMessageExample in project portal by ixinportal.
the class ExtraMessageController 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) throws Exception {
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
Integer offset = size * (page - 1);
ExtraMessageExample example = new ExtraMessageExample();
ExtraMessageExample.Criteria criteria = example.createCriteria();
Integer count = extraMessageService.countByExample(example);
example.setLimit(size);
example.setOffset(offset);
List<ExtraMessage> extraMessages = extraMessageService.selectByExample(example);
uiModel.addAttribute("extraMessages", extraMessages);
uiModel.addAttribute("page", page);
uiModel.addAttribute("size", size);
uiModel.addAttribute("count", count);
return "extramessage/list";
}
Aggregations