解決方法: 檢查xml配置是否被掃描到。
1. 在pom.xml文件中添加,否則xml文件不能被掃描到:
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
2. 添加mybatis的xml映射文件掃描, mybatis-plus和mybatis的添加方法:
mybatis-plus.mapper-locations = classpath:com/hand/hcf/cloud/**/*.xml
mybatis.mapper-locations = com/hand/hcf/app/payment/persistence/*Mapper.xml