通过用Mabatis的逆向工程生成的Entity和Mapper。在Service层注入的时候一直提示Could not autowire. No beans of 'xxxMapper' type found

SpringBoot注入Mapper提示Could not autowire. No beans of 'xxxMapper' type found错误-LMLPHP

这里报错是:UserMapper是个接口。

解决办法1:

SpringBoot注入Mapper提示Could not autowire. No beans of 'xxxMapper' type found错误-LMLPHP

解决办法2:在Mapper加上@Repository

SpringBoot注入Mapper提示Could not autowire. No beans of 'xxxMapper' type found错误-LMLPHP

05-11 18:02