refactor: 更新mapper文件扫描路径配置

- HwWebMapper1.java 里的方法存在,但对应的 XML 语句没有被 MyBatis 加载,所以运行到 selectHwWebList 时,找不到绑定语句,抛出:
  Invalid bound statement (not found): com.ruoyi.portal.mapper.HwWebMapper1.selectHwWebList
  证据链如下:
  application.yml (line 106) 配的是:
  mapperLocations: classpath*:mapper/**/*Mapper.xml
  这个通配符只会匹配文件名以 Mapper.xml 结尾的 XML。
  你的实际文件是 HwWebMapper1.xml (line 1),文件名结尾是 Mapper1.xml,不会被上面的规则匹配到。
  但接口 HwWebMapper1.java (line 37) 里确实声明了 selectHwWebList(...)。
  XML 里也确实定义了 selectHwWebList (line 25),只是“没扫进去”。
  所以不是 Controller 写错,也不是 select id 少写,而是 mapperLocations 规则太窄。
main
zangch@mesnac.com 5 days ago
parent c692bb427e
commit b9bc38bbcc

@ -103,7 +103,7 @@ mybatis-plus:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
mapperLocations: classpath*:mapper/**/*.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml

Loading…
Cancel
Save