Field userMapper inUserServiceImpl required a bean of type xxxMapper that could not be found

网上的一些解决办法用处不大,发现其实是
导入mybatis包的错误

之前导入的包是:

org.mybatis:mybatis:3.5.11”

改成

compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2”)

就好了