mybatisPlus报orq.apache ibatisbinding.BindingException: Invalid bound statement (not found)错误

发布时间 2023-11-28 17:02:59作者: qqq9527

 出现这种问题依次检查下列内容

1.检查xml映射文件中标签绑定包名地址是否正确(即namespace的值)
2.检查xxxMapper接口中的方法,对应xml映射文件中是否有
3.检查标签中的resultType是否与xxxMapper接口中的方法返回值类型一致,若一个是对象一个是集合,那也会报错~
4.检查yml配置文件中的mybatis配置

最终经过排查发现mybatis plus 配置的不对

# mybatis 配置
mybatis:
configLocation: classpath:mybatis/mybatis-config.xml
mapperLocations: classpath:mybatis/mapper/*.xml
typeAliasesPackage: com.owinfo.service

修改为:

# mybatis 配置
mybatis-plus:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations:
- classpath:mybatis/mapper/*.xml
- classpath*:shared/mapper/*.xml
type-aliases-package: com.owinfo.service.core.entity