mybatis-plus两个limit坑
发表于|更新于
|浏览量:
要成就大事业就要趁青年时代。 ——歌德
前两天遇到一个坑,使用mybatis-plus的时候,SQL出现两个LIMIT

经过查阅官方文档才发现,这是因为配置了两个分页拦截器

经过检查,果然发现两个


然后我去掉一个后就解决了
经过这次BUG,我总结出用别人的框架/组件,一定要多阅读官方文档,这样才不会踩了坑也不知道怎么办
相关推荐
2020-07-23
mybatis中if-else
mybatis中if-else要用choose-when-otherwise 12345678<choose> <when test="page !=null and page.orderBy != null and page.orderBy != ''"> ORDER BY ${page.orderBy} </when> <otherwise> ORDER BY a.update_date DESC </otherwise></choose>
2024-03-03
apache-tika从ppt-pdf-xls读取文本
你若要喜爱自己的价值,你就得给世界创造价值。——歌德 代码仓库: GitHub - apache/tika: The Apache Tika toolkit detects and extracts metadata and text from over a thousand different file types (such as PPT, XLS, and PDF). 官网: https://tika.apache.org/ 快速开始: Apache Tika – Getting Started with Apache Tika 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610...
2020-11-21
mybatis-plus基本使用
如果一个人不知道他要驶向哪个码头,那么任何风都不会是顺风。——小塞涅卡 上回我们写到封装了axios的工具类 今天我把OSS上传文件接了,可以去项目目录自取 前端项目:https://gitee.com/VampireAchao/my-vue-app.git 后端项目:https://gitee.com/VampireAchao/simple-springboot.git 传统代码以点到为止,所以这里就不再多聊OSS,想了解可以看这篇博客 然后我们聊聊mybatis-plus的基本使用 首先引入依赖,这个没什么好说的 12345<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.1.0</version></dependency> 然后我们按照之前创的表去对应新建一个DO 因为之前我们的表结构为这样【T...
2021-05-08
List中随机取一条
放纵自己的欲望是的祸害;谈论别人的隐私是的罪恶;不知自己过失是的病痛——亚里士多德 如下 12345678910111213141516171819public static void main(String[] args) { List<Integer> list = Stream.iterate(0, i -> ++i).limit(10).collect(Collectors.toList()); System.out.println(getAny(list));}/** * 随机获取一条 * * @param list 集合 * @return T 数据 * @author <achao1441470436@gmail.com> * @date 2021/5/8 0008 9:07 */public static <T> T getAny(List<T> list) { if (Objects.isNull(list) || list.isEmpty()) {...
2022-09-08
hutool获取excel中的图片
人无礼而何为,财非义而不取——耐施庵 依赖如下: 1234567891011<dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>5.8.6</version></dependency><!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --><dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>5.2.2</version></dependency> 代码如下: 123456789101112131415161718...
2021-03-29
groupingBy
老老实实最能打动人心。——莎士比亚 你们可能知道Collectors.groupingBy是干嘛的了,没错分组 例如我们需要把用户根据age分组 1234SecureRandom random = new SecureRandom();List<User> users = random.ints(20,25).parallel().mapToObj(r -> User.builder().name(Faker.instance(Locale.CHINA).name().username()).age(r).build()).limit(20).collect(Collectors.toList());Map<Integer, List<User>> listMap = users.stream().collect(Collectors.groupingBy(User::getAge));listMap.forEach((k, v) -> System.out.println(k + ":" + v)); ...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog