springcloud 中出现Invalid bound statement (not found)解决方案

找了网上各种答案,基本上都是
检查包名+函数名=namespace
检查id=函数名(同时参数类型和返回类型是否一致)
建议直接复制粘贴,避免手动出错。如果确认上面两个地方无误后,下面的方法可能极其有效:
去掉mapper文件中的中文注释
随意在mapper文件中加空格或空行然后保存
最后都没用,检查了一下配置文件,发现配置如下

mybatis-plus:
  mapper-locations: classpath*:mapper/*.xml
  type-aliases-package: com.common.center.modules.league.entity

在公共模块中没有扫描到mapper文件,修改配置后就OK了

mybatis-plus:
  mapper-locations: classpath*:com/common/center/modules/league/mapper/*.xml
  type-aliases-package: com.common.center.modules.league.entity
  global-config:
发布了26 篇原创文章 · 获赞 1 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_42643690/article/details/103891765