1:首先查看mapper接口跟mapper.xml的映射关系,包括namespace、方法名等
2、检查mapper-locations是否配置正确,如mapper-locations: classpath:com/ypxm/*/mapper/.xml
如果以上都正确,且mapper文件放在src/main/java下,则在pom.xml中加入
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>