Search in sources :

Example 1 with ReceiptConfigExample

use of com.itrus.portal.db.ReceiptConfigExample in project portal by ixinportal.

the class ReceiptConfigController method list.

// 列表所有信息
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "message", required = false) Integer message, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) throws Exception {
    // page,size
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    // count,pages
    Integer count = sqlSession.selectOne("com.itrus.portal.db.ReceiptConfigMapper.countByExample", 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);
    // query data
    Integer offset = size * (page - 1);
    ReceiptConfigExample rconfigex = new ReceiptConfigExample();
    // projectex.or().andIdIsNotNull();
    rconfigex.setOffset(offset);
    rconfigex.setLimit(size);
    List<ReceiptConfig> rconfigexall = sqlSession.selectList("com.itrus.portal.db.ReceiptConfigMapper.selectByExample", rconfigex);
    uiModel.addAttribute("receiptconfigs", rconfigexall);
    // itemcount
    uiModel.addAttribute("itemcount", rconfigexall.size());
    uiModel.addAttribute("message", message == null ? "" : "要删除的支付配置存在关联,无法删除");
    return "receiptconfig/list";
}
Also used : ReceiptConfigExample(com.itrus.portal.db.ReceiptConfigExample) ReceiptConfig(com.itrus.portal.db.ReceiptConfig)

Aggregations

ReceiptConfig (com.itrus.portal.db.ReceiptConfig)1 ReceiptConfigExample (com.itrus.portal.db.ReceiptConfigExample)1