When using Springboot to write an MVC process, I encountered a failure to inject MapperDao into ServiceImpl

Case analysis
When we used Springboot for development, we encountered failure to inject MapperDao into ServiceImpl, and encountered the following scenario
Insert picture description here
solutions

Add the annotation @Mapper in DaoMapper
注意 @Mapper 使用的是 Mybatis 的注解,跟Spring没有联系,@Repository 是 Spring 的注解,用于声明一个 Bean。
, @Repository In short, Mapper must have it, MapperScan can replace Mapper

Guess you like

Origin blog.csdn.net/weixin_46195957/article/details/110677673