SpringBoot整合mybatis-plus mapper的bean对象注入报错
mapper.AccountMapper’ available: expected at least 1 bean which qualifies as autowire candidate.
意为是所对应的Mapper的实体类对象创建失败,因为无法通过autowire注解获取mapper的对象。在这时候一般都是注入过程中出现了差错,可以初步判断为springboot没有扫描到mapper类,这时候有两种解决方式:
(1)在对应mapper类上添加注解@Mapper
(2)在springboot的启动类上加@MapperScan注解