SpringBoot之项目启动提示扫描不到Mapper文件

一、报错提示

1.No MyBatis mapper was found in '[com.iyungu.phantaci]' package. Please check your configuration.

2.SpringBoot之项目启动提示扫描不到Mapper文件

二、解决方式

在springboot的启动类里加注解:@MapperScan("com.iyungu.phantaci.dao"),括号里的是Mapper接口所在路径。加上注解后,重启项目,正常。

附上demo项目的目录截图:

SpringBoot之项目启动提示扫描不到Mapper文件