模板引擎Thymleaf 整合org.springframework.boot spring-boot-starter-web
org.springframework.boot spring-boot-starter-thymeleaf
配置文件
spring:
thymeleaf:
cache: false # 关闭缓存,默认开启
prefix: classpath:/pages/ #修改默认路径 classpath:/templates/
Mybatis 整合
org.mybatis.spring.boot mybatis-spring-boot-starter2.1.1 mysql mysql-connector-javaruntime
配置文件
spring:
datasource:
url: jdbc:mysql://localhost:3306/qcby_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=CTT
username: root
password:
driver-class-name: com.mysql.cj.jdbc.Driver
mybatis:
mapper-locations: classpath:mapper/*.xml #对应mapper映射xml文件所在路径
type-aliases-package: com.xxxx.entity #对应实体类路径
启动类
// 启动类修改
@MapperScan("com.xxxx.mapper")
@SpringBootApplication
PageHelper 分页插件整合
com.github.pagehelper pagehelper-spring-boot-starter1.3.0
配置文件
pagehelper: helperDialect: mysql reasonable: true # 修改默认值



