Description:
Field scheduleMapper in com.hawk.hospital.service.impl.ApiServiceImpl required a bean of type 'com.hawk.hospital.mapper.ScheduleMapper' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.hawk.hospital.mapper.ScheduleMapper' in your configuration.
看了一下,Mapper类已经加了@Mapper注解
解决方法:在启动类加上@MapperScan注解,扫描指定包
@MapperScan("com/hawk/hospital/mapper")
@SpringBootApplication
public class ManageApplication {
public static void main(String[] args) {
SpringApplication.run(ManageApplication.class, args);
}
}