application.properties配置文件
#数据库
spring.datasource.url=jdbc:mysql://localhost:3306/?usercharacterEncoding=UTF8
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
#包扫描
mybatis.mapper-locations=classpath*:mapper/*.xml
#别名
mybatis.type-aliases-package=com.bdqn.springbootone.entity
导包pom节点
<!-- mybatis -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.1.1</version></dependency>
<!--mysql-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version></dependency>
<!--JSON-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>