1、先看一下自己pom配置
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
低版本1.5不行
<dependency>-->
<groupId>tk.mybatis</groupId>-->
<artifactId>mapper</artifactId>-->
<version>4.2.2</version>-->
</dependency>-->
不要这个依赖,pom中只能依赖一种不然冲突
2、看一下SpringBootApplication导入的依赖是不是
import tk.mybatis.spring.annotation.MapperScan
@MapperScan(basePackages= {"catl.mapper.*"})
不要 import org.mybatis.spring.annotation.MapperScan
标签:mapper,--,spring,idea,MapperScan,base,tk,mybatis From: https://www.cnblogs.com/hjwbkcom/p/16889817.html