mybaits起步依赖
<!-- mybatis的起步依赖 --><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId></dependency><!-- mysql驱动 --><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency>
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="mapUnderscoreToCamelCase" value="true"/><!-- 打印SQL语句 --><setting name="logImpl" value="STDOUT_LOGGING"/></settings><plugins><!-- 分页插件 --><plugin interceptor="com.github.pagehelper.PageInterceptor"/></plugins>
</configuration>
application-dev.xml
mybatis:config-location: classpath:mybatis-config.xmlmapper-locations: classpath:/mapper/*.xml