机灵的程序员 2021-11-19 17:38 采纳率: 0%
浏览 167
已结题

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

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

  • 写回答

3条回答 默认 最新

  • 关注

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

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 7月19日
  • 创建了问题 11月19日

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程