使用mybatis出现异常

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xiaohe.mapper.EduCourseMapper.getPublishCourseInfo
== 分析:maven项目在编译过程中,java目录下面的.java文件才会编译运行,详细看target目录,当xml写在mapper则不能实现sql功能==
目录格式:

解决方案

1、在pom中添加

   <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>

2、在application.yml中添加

mybatis-plus:
  mapper-locations: classpath:com/xiaohe/mapper/xml/*.xml

解决

原文地址:https://www.cnblogs.com/HezhenbinGoGo/p/14313743.html