mybatis-plus错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

一、问题描述

运行项目,访问Controller提示错误如下:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.dao.OrderMapper.getUnPayedOrder
    at com.baomidou.mybatisplus.core.override.PageMapperMethod$SqlCommand.<init>(PageMapperMethod.java:261) ~[mybatis-plus-core-3.0.6.jar:3.0.6]
    at com.baomidou.mybatisplus.core.override.PageMapperMethod.<init>(PageMapperMethod.java:58) ~[mybatis-plus-core-3.0.6.jar:3.0.6]
    at com.baomidou.mybatisplus.core.override.PageMapperProxy.cachedMapperMethod(PageMapperProxy.java:70) ~[mybatis-plus-core-3.0.6.jar:3.0.6]
    at com.baomidou.mybatisplus.core.override.PageMapperProxy.invoke(PageMapperProxy.java:63) ~[mybatis-plus-core-3.0.6.jar:3.0.6]
    at com.sun.proxy.$Proxy113.getUnPayedOrder(Unknown Source) ~[na:na]
    at com.sanyi.smiler.service.RoomOrderService.getUnPayedOrder(RoomOrderService.java:138) ~[classes/:0.0.1-SNAPSHOT]
    at com.sanyi.smiler.service.RoomOrderService$$FastClassBySpringCGLIB$$dde6e794.invoke(<generated>) ~[classes/:0.0.1-SNAPSHOT]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) ~[spring-aop-5.1.2.RELEASE.jar:5.1.2.RELEASE]

二、解决方法

查询网上各种相关的解决办法,都不适用。认真根据问题描述,重新查了一遍问题日志,最终把问题原因锁定在mybatis-plus的配置文件上:

mybatis-plus错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

多了两个空格!!!type-aliases-package和mapper-locations属性与configuration是同级关系!

修改后问题解决