springboot mybatis-plus分页配置不生效【我】
2023-09-27 14:28:21 时间
转:
SpringBoot + MyBatis-Plus分页插件不生效解决办法
https://blog.csdn.net/weixin_41432270/article/details/103072230
原来是启动类没有指定扫描包,配置类和组件类默认需要在启动类所在包或其子包下,如果不是,需要使用@ComponentScan指定,在启动类添加,我是直接扫描所有包,可以直接扫描配置类所在包
@ComponentScan("com.example.mybatis.plus.mybatisplus.*")
关键就是如果config配置类不在启动类所在包或其子包,要在启动类上添加扫描包注解扫描到config类
@SpringBootApplication(scanBasePackages = {"com.tc.crm.order.query", "com.tc.crm.common.aspect", "com.tc.crm.common.config" }) public class OrderQueryApplication { public static void main(String[] args) { SpringApplication.run(OrderQueryApplication.class, args); } }
相关文章
- 实现SpringBoot项目的多数据源配置的两种方式(dynamic-datasource-spring-boot-starter和自定义注解的方式)
- SpringBoot 分布式session共享方案(并且可实现session在多个项目中共享)
- SpringBoot_整合Druid
- mybatis:在springboot中的配置
- springboot:mybatis多数据源配置
- springBoot 整合servlet
- 聊一聊 SpringBoot 自动配置的原理
- SpringBoot通过配置devtools实现热部署
- 笑死,面试官又问我SpringBoot自动配置原理
- 【RocketMQ】SpringBoot整合RocketMQ(下) 事务篇
- springboot 通过@WebFilter(urlPatterns )配置Filter过滤路径
- springboot中各个版本的redis配置问题
- SpringBoot Redis序列化配置
- Springboot+shiro配置笔记+错误小结
- SpringBoot Druid 配置详解
- springboot 打包插件去除jar包瘦身
- springboot 2.1.3 + mybatis + druid配置多数据源
- springboot 配置 https
- springboot使用redis(从配置到实战)
- mybatis-plus springboot配置xml文件不在resources文件夹下的解决方法--Invalid bound statement (not found): com.xx..mapper.xxMapper.xx
- [SpringBoot系列]基础过渡与夯实(基础配置)
- 【SpringBoot源码剥析】| 自动配置原理
- springboot的mybatis的xml相关的配置
- springboot日志配置【我改】
- SpringBoot使用Nacos配置中心
- springboot整合ElasticSearch-7.16.2(看完即入门)
- SpringBoot2.x系列教程(三十八)SpringBoot配置Https访问
- 自定义SpringBoot默认MVC配置?好几个坑,这篇文章必须珍藏