spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
# 数据库用户名、密码
username: root
password: root
# 连接数据库、端口号 JDBC
url: jdbc:mysql://kaapr83.nat.ipyingshe.com:15761/hotel?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
cache:
cache-names: menus_cache
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
#端口号
server:
port: 8080
compression:
enabled: true
# 配置mapper的扫描,找到所有的mapper.xml映射文件 此处是mappers包
mybatis:
# model的包
type-aliases-package: com.lucun.model
mapper-locations: classpath:mappers/*.xml # mapper映射文件
configuration:
# 开启驼峰命名_下划线变为后面大写
map-underscore-to-camel-case: true
# 打印sql
logging:
level:
ssm.app.mapper : debug
启动器加注解
@SpringBootApplication
@MapperScan(basePackages = "com.example.hotelmanagement.mapper")//该为自己的mapper路径