查詢分頁(yè)失敗
@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("總頁(yè)數(shù):"?+iPage.getPages()); ????System.out.println("總記錄數(shù):"?+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
'總頁(yè)數(shù):0
總記錄數(shù):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)
2021-12-19
https://baomidou.com/pages/8f40ae/
這里是新的分頁(yè)插件的配置方法,要確保分頁(yè)插件的配置被spring正確加載