原因:使用了
<!--集成通用Mapper插件-->
<dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</artifactId> <version>1.1.4</version> </dependency>
在启动类使用注解@MapperScan("com.dmo.mapper")
要使用 import tk.mybatis.spring.annotation.MapperScan;
而不是 import org.mybatis.spring.annotation.MapperScan;
另外的解决方案是在mapper层加注解
@org.apache.ibatis.annotations.Mapper