server:
port: 8080
spring:
datasource:
url: jdbc:mysql://localhost:3306/hotel?serverTimezone=CTT&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
username: root
password: 123456
resources:
static-locations: classpath:/templates/,classpath:/static/
thymeleaf:
cache: false
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations: classpath:/mapper/*.xml
type-aliases-package: 实体类包路径
#日志
logging:
level:
root: info
file:
name: demo.log
path: logs
#PageHelper分页插件
pagehelper:
# 分页插件会自动检测当前的数据库链接,自动选择合适的分页方式(可以不设置)
helper-dialect: mysql
# 上面数据库设置后,下面的设置为true不会改变上面的结果(默认为true)
page-size-zero: true
reasonable: true
support-methods-arguments: true
params: count=countSql
贴个文件结构图,免得大家搞错了!

本文介绍如何在Spring Boot应用中配置MyBatis Plus,包括数据库连接、Thymeleaf缓存设置、PageHelper分页插件的使用及Druid数据源配置等。
&spm=1001.2101.3001.5002&articleId=109038980&d=1&t=3&u=2e2ab2833c0f49c89f19563164cc1f77)
683

被折叠的 条评论
为什么被折叠?



