SpringBoot整合mybatis-plus异常:Unsatisfied dependency expressed through field 'mapper'解决办法
报错信息截取:
Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean
解决办法:springboot启动类上加 @MapperScan();注解,如下
@SpringBootApplication
@MapperScan(value = "com.xxxxx.xxxx.mapper")
public class ManagesysApplication {
注:网上还有一种写法:就是在mapper接口上添加@Mapper注解,然而这种写法并不能解决扫包不全的问题。用上面的做法,指定扫描路径即可。