先看一下报错信息:
 Invalid bound statement:意思是无效的绑定语句
Invalid bound statement:意思是无效的绑定语句
原因就是:在使用mybatis时mapper.xml没有和mapper接口对应起来
解决方式
第一种:
将mapper.xml和mapper接口放在同一位置
在pom中配置:
 <resources>
    <!-- mapper.xml文件在java目录下 -->
    <resource>
        <directory>src/main/java</directory>
        <includes>
            <include>**/*.xml</include>
        </includes>
    </resource>
</resources>
在application.xml中配置:
mybatis:
    # 项目的mapper路径
    mapper-locations: classpath:com/javacoding/mapper/*.xml
第二种:
在resource文件下创建mapper文件夹,mapper.xml放在该文件夹下
pom配置:
 <resources>
        <!-- mapper.xml文件在resources目录下-->
        <resource>
            <directory>src/main/resources</directory>
         </resource>
 </resources>
application配置:
mybatis:
    # mapper映射文件
    mapper-locations: classpath:mapper/*.xml     
注:在resource文件夹下创建文件目录时需要一级一级创建(非常重要)
下面给出错误案例:

正确:




















![[NOIP2016 普及组] 回文日期](https://img-blog.csdnimg.cn/direct/c0495f9f05004418816f008697a54536.png)