MyBatis切换至MyBatis-plus踩坑Invalid bound statement (not found):

部分情况可以参考https://blog.csdn.net/wwrzyy/article/details/86034458

我的问题出现的根本原因就是没有扫描到mapper的xml文件
因为MyBatis与MyBatis-plus配置不同
我在切换后,没有写MyBatis-plus的配置,只是保留了MyBatis的配置

mybatis:
  config-location: classpath:mybatis/mybatis-config.xml
  mapper-locations: classpath:mybatis/mapper/*.xml

  configuration:
    map-underscore-to-camel-case: true

上面是MyBatis的配置,应删掉,并修改为,注意是mybatis-plus

mybatis-plus:
  mapper-locations: classpath:mybatis/mapper/*.xml
  
  configuration:
    map-underscore-to-camel-case: true
posted @ 2021-03-02 16:57  微花  阅读(149)  评论(0编辑  收藏  举报

Loading