为了账号安全,请及时绑定邮箱和手机立即绑定

查询分页失败

@Test
public void selectPage() {
    QueryWrapper<RtkHistory> queryWrapper = new QueryWrapper<RtkHistory>();
    queryWrapper.apply("date_format(create_time,'%Y-%m-%d')= {0}" ,"2021-12-09")
            .and(i ->i.eq("name","温湿度")).and(i ->i.eq("name2","temp ="));

    Page<RtkHistory> Page = new Page<RtkHistory>(1, 5);
    Page<RtkHistory> iPage = rtkHistoryMapper.selectPage(Page, queryWrapper);
    System.out.println("总页数:" +iPage.getPages());
    System.out.println("总记录数:" +iPage.getTotal());
    List<RtkHistory> historyList = iPage.getRecords();
    for (RtkHistory rtkHistory : historyList) {
        System.out.println(rtkHistory);
    }

''TRACE<==        Row: 4356, 117, 温湿度, 16.7, 2021-12-09 21:16:30

''TRACE<==        Row: 4367, 117, 温湿度, 16.7, 2021-12-09 21:17:10

''DEBUG<==      Total: 222

'总页数:0

总记录数:0

RtkHistory(id=1969, pid=117, name=温湿度, body=16.3, createTime=2021-12-09T14:35:01)

RtkHistory(id=1979, pid=117, name=温湿度, body=15.2, createTime=2021-12-09T14:35:41)

RtkHistory(id=1990, pid=117, name=温湿度, body=15.2, createTime=2021-12-09T14:36:21)

RtkHistory(id=2001, pid=117, name=温湿度, body=15.2, createTime=2021-12-09T14:37:01)

RtkHistory(id=2012, pid=117, name=温湿度, body=15.3, createTime=2021-12-09T14:37:41)

RtkHistory(id=2023, pid=117, name=温湿度, body=15.3, createTime=2021-12-09T14:38:21)

RtkHistory(id=2034, pid=117, name=温湿度, body=15.3, createTime=2021-12-09T14:39:01)


正在回答

1 回答

https://baomidou.com/pages/8f40ae/

这里是新的分页插件的配置方法,要确保分页插件的配置被spring正确加载

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

查询分页失败

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信