報錯信息截取:
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注解,然而這種寫法並不能解決掃包不全的問題。用上面的做法,指定掃描路徑即可。