解决springboot+mybaties报错Invalid bound statement (not found):

主要引起的原因可能有几点:

用一个示例来讲解

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shanyuan.dao.CDao">

<select id="getOwnersAmountTotal" resultType="java.lang.Integer">
select sum(owners_amount) from community
</select>

</mapper>

1、两处标黄的位置,确认是否正确,路径是否匹配

2、也是我碰到的奇葩问题

 在resources下创建文件夹的时候

务必不能直接连写 com.shanyuan.dao

必须要依次创建,如 com--->shanyuan----->dao 

否则也会报Invalid bound statement (not found):  从而找不到xml文件

  

原文地址:https://www.cnblogs.com/memoa/p/11652953.html