新闻动态

行业新闻企业新闻安博电竞

详解Mybatis-Plus中分页插件PaginationInterceptor, MybatisPlusInterceptor在SpringBoot中的使用 gG4lGgli

安博电竞

文章目录

1. 描述

1.1 MybatisPlusInterceptor

我们在开发的过程中,经常会遇到分页操作,其分为逻辑分页和物理分页,具体可参考我的博文:逻辑分页和物理分页

如果你用的是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,AI,人工智能,聊天机器人,女友聊天机器人,在线ai对话,二次元聊天

chatgpt免费软件,chatgpt api 免费接口,chatgpt 聊天机器人教程,chatgpt 指令大全,chatgpt app

详解Mybatis-Plus中分页插件PaginationInterceptor, MybatisPlusInterceptor在SpringBoot中的使用

CHATGPT驱动智能化搜索 :百度的前瞻布局

百度利用CHATGPT的智能生成能力,不仅提升了搜索引擎的中t中质量,还为用户提供了更智能、分页更有针对性的插件搜索结果 。CHATGPT使得搜索更加智能化,详解更能满足用户的中t中需求 。

分页