原因之一:
找不到这个xxxMapper接口对应的xxxMapper.xml文件
解决方法:
举例:springboot项目
在yml文件添加:(路径对应你的*Mapper.xml文件路径)
mybatis-plus:
configuration:
call-setters-on-nulls: true
mapperLocations: classpath*:com/gdata/biz/**/mapper/xml/*Mapper.xml
在pom.xml添加:(添加之后要刷新maven)
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
xml存放resources下
<resources> <!-- mapper.xml文件在resources目录下--> <resource> <directory>src/main/resources</directory> </resource> </resources>