Search in sources :

Example 1 with ExtraMessageExample

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";
}
Also used : ExtraMessageExample(com.itrus.portal.db.ExtraMessageExample) ExtraMessage(com.itrus.portal.db.ExtraMessage) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ExtraMessage (com.itrus.portal.db.ExtraMessage)1 ExtraMessageExample (com.itrus.portal.db.ExtraMessageExample)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1