项目依赖包 springboot + mybatis + mysql
完成了。
pom.xml 文件加
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--热部署插件-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
application.yml 文件
server:
port: 8080
spring:
thymeleaf:
cache: false
prefix: classpath:/templates/html/
suffix: .html
encoding: UTF-8
mode: HTML5
servlet:
content-type: text/html
datasource:
url: jdbc:mysql://localhost:3306/hrsources?useUnicode=true&characterEncoding=utf8
username: root
password: 1234
# ʹdruid'
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
mybatis:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.test.demo.*.mapper