我们在开发的过程中,经常会遇到分页操作,其分为逻辑分页和物理分页,具体可参考我的博文:逻辑分页和物理分页
如果你用的是Mybatis-Plus
框架,可用MybatisPlusInterceptor
按如下配置分页代码:
/*** @author 念兮为美* @datetime 2022/11/28 14:10* @desc mybatis plus 配置类*/@Configurationpublic class MybatisPlusConfig {Long currentPage = 4L;Long pageSize = 3L;Page page = new Page<>(currentPage, pageSize, false);List pageUsers = userMapper.findPageUsers(page);page.setRecords(pageUsers);return page;}
从输出结果看,既没有count
操作,如下所示:
JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@466c39de] will not be managed by Spring==> Preparing: select username,nickname,user_type as userType from user order by create_time desc LIMIT ?,?==> Parameters: 9(Long), 3(Long)<== Columns: username, nickname, userType<== Row: cs, null, admin<== Row: lin, null, admin<== Row: test3, null, TEST4<== Total: 3
chatgpt免费软件,chatgpt api 免费接口,chatgpt 聊天机器人教程,chatgpt 指令大全,chatgpt app
百度利用CHATGPT的智能生成能力