问题的起因是因为在搭建 spring-booot、mybatis-plus、的 maven 多模块项目时,抛出了异常
Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): xxxx
异常的信息是说,dao接口在绑定mapper.xml文件时,没有绑定上,mapper.xml不存在,出现这个问题的原因是因为mapper文件放在了子模块中,项目没有去扫描子模块的mapper目录,最后导致抛出了异常
之前的mapper 文件位置设这样设置的
mapper-locations: classpath:mapper/*.xml
改成
mapper-locations: classpath*:mapper/*.xml