在確認(rèn)mapperScan 和application.yml配置文件均沒有問(wèn)題的情況下邻梆,檢查mybatis-plus插件的引入jar包是否正確双谆。
Spring Boot
Maven:
<dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.1.0</version></dependency>
Gradle:
compile group:'com.baomidou',name:'mybatis-plus-boot-starter',version:'3.1.0'
---------------------------------------------------------------------------------------------------------
Spring MVC
Maven:
<dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus</artifactId><version>3.1.0</version></dependency>
Gradle:
compile group:'com.baomidou',name:'mybatis-plus',version:'3.1.0'
WARNING
引入?MyBatis-Plus?之后請(qǐng)不要再次引入?MyBatis?以及?MyBatis-Spring次和,以避免因版本差異導(dǎo)致的問(wèn)題黍图。
具體請(qǐng)看mybatis-plus官網(wǎng):https://mp.baomidou.com/guide/install.html#release