pagehelper-spring-boot icon indicating copy to clipboard operation
pagehelper-spring-boot copied to clipboard

PageHelper.startPage(pageNum, pageSize);当pageNum=0 和 pageNum=1查询出来的结果相同

Open maxiaodong58 opened this issue 6 years ago • 2 comments

当:pageNum = 0,查询结果: {"data":[{"createTime":1533301506000,"createType":1,"deleteFlag":0,"fakeId":"ce3594a06f3e45d4aa8c9c503bf2d3ac","id":280,"noticeContent":"2222","noticeNum":11,"noticeRiseId":37,"noticeTitle":"2222","noticeType":2,"noticeUnits":"","pictureUrl":"https://cdn.i31.com/oss/img/upload/c276902345f544be85a60bd4aa61d9b61533301505918.jpeg","updateTime":1533301506000,"userId":1369620,"userName":"222"},{"createTime":1533301465000,"createType":1,"deleteFlag":0,"fakeId":"4a801d63f06d43e1a37d04042d12c314","id":279,"noticeContent":"ds","noticeNum":10,"noticeRiseId":37,"noticeTitle":"ds","noticeType":2,"noticeUnits":"","pictureUrl":"https://cdn.i31.com/oss/img/upload/79c2a54637f84829baebdcdd5048ef0c1533301464504.jpeg","updateTime":1533301465000,"userId":1369620,"userName":"sss"}],"pageNum":0,"pageSize":2,"pages":7,"total":14}

当:pageNum = 1,查询结果: {"data":[{"createTime":1533301506000,"createType":1,"deleteFlag":0,"fakeId":"ce3594a06f3e45d4aa8c9c503bf2d3ac","id":280,"noticeContent":"2222","noticeNum":11,"noticeRiseId":37,"noticeTitle":"2222","noticeType":2,"noticeUnits":"","pictureUrl":"https://cdn.i31.com/oss/img/upload/c276902345f544be85a60bd4aa61d9b61533301505918.jpeg","updateTime":1533301506000,"userId":1369620,"userName":"222"},{"createTime":1533301465000,"createType":1,"deleteFlag":0,"fakeId":"4a801d63f06d43e1a37d04042d12c314","id":279,"noticeContent":"ds","noticeNum":10,"noticeRiseId":37,"noticeTitle":"ds","noticeType":2,"noticeUnits":"","pictureUrl":"https://cdn.i31.com/oss/img/upload/79c2a54637f84829baebdcdd5048ef0c1533301464504.jpeg","updateTime":1533301465000,"userId":1369620,"userName":"sss"}],"pageNum":1,"pageSize":2,"pages":7,"total":14}

maxiaodong58 avatar Sep 20 '18 12:09 maxiaodong58

应该给一个报错信息,pageNum不能为0;

maxiaodong58 avatar Sep 20 '18 12:09 maxiaodong58

如果你开启了分页合理化,<=0时,都按1处理。。否则查询结果空。

abel533 avatar Sep 25 '18 05:09 abel533