public void index() { int pageNo = getParaToInt("pageNo", 1); int pageSize = getParaToInt("pageSize", 10); Page<User> userPage = User.dao.paginate( pageNo, pageSize, "select u.username,u.is_locked,u.id,r.name,r.description ", "from system_user u " + "LEFT JOIN system_user_role ur on ur.user_id = u.id " + "LEFT JOIN system_role r on r.id = ur.role_id "); TablePage tp = new TablePage(pageNo, pageSize, userPage.getTotalRow(), userPage.getTotalPage()); setAttr("page", userPage); setAttr("pageStr", tp.toString()); render("index.html"); }
protected void setJsonData(Page page) { if (page != null) { json.setData("list", page.getList()); json.setData("total", page.getTotalRow()); } else json.code = serviceError; }