问题:mybtis报错:org.apache.ibatis.binding.BindingException: Type interface com.joinbright.iot.alarmer.utils.mybatis.dao.AlarmingDataMapper is not known to the MapperRegistry.
原因:项目中配有2个实体类↓
打包后只有1个实体类↓
分析:项目打包时配置文件为旧文件,未更新。当执行数据库操作时就会失败↓
解决办法:在pom.xml中增加如下配置,打包时更新xml文件
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
<excludes>
<!--<exclude>*.properties</exclude>-->
<!--<exclude>*.xml</exclude>-->
<!--<exclude>mapper/*.xml</exclude>-->
</excludes>
</resource>
</resources>