- application.yml
检查是否增加了mapper-Locations
mybatis:
mapper-Locations: classpath*:/mapper/*.xml
configuration:
map-underscore-to-camel-case: true # 数据库_对象转驼峰自动转换
这里我设定的mapper.xml在resource/mapper下面
- Springboot启动类
增加@MapperScan
注解,扫描Mapper路径
mapper.xml 检查namespace是否可以对应mapper
到此,感谢各位观看,希望能帮助到大家。如果有不对的地方或更好的建议还请大佬们指教。