Description: A component required a bean of type 'com.example.democrud.democurd.usermapper.DaoMapper' that could not be found. Error creating bean with name 'userServiceImpl': Action: Consider defining a bean of type 'com.example.democrud.democurd.usermapper.DaoMapper' in your configuration.
我自己解决方式:
在pom导入mybatis
<!-- mybatis整合Springboot --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.1.1</version> </dependency>
注解在mapper 加入 @Mapper
也可加mapperscan(“mapper路径”) @Mapper
在启动类加入
@MapperScan(basePackages = "com.example.democrud.democurd.usermapper")