如题:在testcontroller调用service层里的方法,报错,直接调用service层内部的mapper层的方法不报错。
解决如下:
出错点是启动类的@MapperScan扫描不到位,要扫到下一个具体的包
将@MapperScan("com.huangxinyi.petmanage")改为
@MapperScan("com.huangxinyi.petmanage.mapper")
包名要根据自身项目对应更改
项目结构如下:

test如下:

错误如下:

service层、serviceimpl层如下:

mapper、mapper.xml如下

yml文件、启动类如下

参考文档:
service层找不到方法 Invalid bound statement (not found)_万如的博客-优快云博客