springboot 集成mybatis

首先创建springboot项目

 

 

 yml配置

server:
port: 8080
connectionTimeout: 1800000 连接时间
spring:
 profiles: dev 启动环境
datasource:
url: jdbc:mysql://192.168.3.50:3306/314?useSSL=false&characterEncoding=utf8&autoReconnect=true
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver

mybatis:
mapper-locations: classpath*:mapper/*Mapper.xml
configuration:
database-id: MySQL
fdfs:
soTimeout: 1500
connectTimeout: 600
thumbImage:
150
height: 150
trackerList: 192.168.3.51:22122
logging:
level:
com.example.mapper: debug

然后就写自己的controller,service,mapper,等了,最后postman测试一下就好了(localhost:8080/你自己的controller)
原文地址:https://www.cnblogs.com/bt2882/p/11850878.html