一、MyBatis配置文件模板
1.1、mybatis-config.xml模板
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name="logImpl" value="STDOUT_LOGGING"/>
</settings>
<typeAliases>
<package name="org.star.entity.model"/>
</typeAliases>
<!--
配置mapper的位置
注意事项:
如果xxxMapper.xml是在resources目录配置的,那么需要创建和src中mapper同名的Directory才行,否则的话就会报
"org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误"
-->
<mappers>
<package name="org.star.mapper"/>
</mappers>
</configuration>
1.2、xxxMapper.xml模板
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="">
</mapper>
1.3、参考
https://blog.csdn.net/inflaRunAs/article/details/103935726