mybatis-plus 中关于xml文件的问题

  • 配置了相应的xml文件,但是启动起来还是报错
    mybatis-plus 中关于xml文件的问题_第1张图片
  • 错误原因是因为找不到配置的xml文件
  • 解决方法
    在application.yml配置
 mybatis-plus:
  mapper-locations: classpath:Mybatis-plus/*.xml

即可

  • 也可以不配置配置文件
    直接在方法上面用@Select(" select * from domain where id=#{id}") 注解直接标注
    mybatis-plus 中关于xml文件的问题_第2张图片2021.4.2号错误

你可能感兴趣的:(spring,boot,spring,mybatis)