标签:return json column isnull 信息 util erb users false
PageHelper.startPage(pageNum, pageSize, sortColumn); List<UcUser> list = userMapper.queryUcUserAll(); PageInfo<UcUser> pageInfo = new PageInfo<>(list); return pageInfo;
项目实例
controller.java
/** * 分页查询所有用户 * * @param */ @RequestMapping("/queryUserAll") @Api public void queryUserAll(Integer pageNum, Integer pageSize, String sortColumn) { if (pageNum == null || pageSize == null) { sendJson(false, "pageNum和pageSize不能为null", ""); return; } PageInfo<UcUser> ucUserPageInfo = userService.queryUcUserAll(pageNum, pageSize, sortColumn); //判断list是否为空 if (ObjectUtil.isNull(ucUserPageInfo)) { sendJson(false, "", ""); return; } sendJson(true, "", ucUserPageInfo); }
service.java
public PageInfo<UcUser> queryUcUserAll(Integer pageNum, Integer pageSize ,String sortColumn) { //String OrderBy = "createtime DESC"; PageHelper.startPage(pageNum, pageSize, sortColumn); List<UcUser> list = userMapper.queryUcUserAll(); PageInfo<UcUser> pageInfo = new PageInfo<>(list); return pageInfo; }
pageInfo中包含分页后的数据,以及总条数等等信息.....
标签:return json column isnull 信息 util erb users false
原文地址:https://www.cnblogs.com/y-song/p/11940237.html