项目是springboot整合的mybatis-plus,代码是由代码生成器直接生成的。
Conntroller层代码如下,eduTeacherService注入成功了,我直接掉dao层的对应的方法是可以的,就是调用service层的方法报了错误。
RestController
@RequestMapping("/edu-teacher")
public class EduTeacherController {
@Resource
private EduTeacherService eduTeacherService;
@GetMapping("selectAll")
public List<EduTeacher> selectAll(){
return eduTeacherService.list();
}
}
主要报错信息
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.shizhun.eduService.service.EduTeacherService.getBaseMapper
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235) ~[mybatis-3.5.6.jar:3.5.6]
我的配置文件的部分内容
application.yml
server:
port: 8001
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations: classpath:mapper/*.xml
global-config:
db-config:
logic-delete-value: 1
logic-not-delete-value: 0
pom.xml
<build>
<resources>
<!-- mapper.xml文件在resources目录下-->
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
目录结构
有没有懂哥知道,万分感谢