最近项目中遇到这个问题,在网上搜索尝试各种办法都无法解决。
最终发现是因为mybatis-plus的版本问题。
我的项目是springboot3.2.0版本,然后
<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>3.0.3</version> </dependency>
本来用的3.0.3换成3.5.3.1。就可以了。可能是springboot和mybatisplus的版本依赖问题。
<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>3.5.3.1</version> </dependency>