Invalid bound statement (not found): com.shizhun.eduService.service.**Service.getBaseMapper

项目是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>

目录结构

img

有没有懂哥知道,万分感谢

mapper-locations 要输入mapper所在目录的完整目录
com.xx.xx.xx

xml里的定义与接口类里的定义有差异,把EduTeacherMapper.xmlEduTeacherMapper.java两个的内容发出来看下。

自己添加的自定义方法也不能用


 @GetMapping("test")
    public void test(){
        eduTeacherService.test();
    }
@Service
public class EduTeacherServiceImpl extends ServiceImpl<EduTeacherMapper, EduTeacher> implements EduTeacherService {

    @Override
    public void test() {
        System.out.println("------------------------------------------测试");
    }
}