mybatis使用流程
1.新建项目,打开mybatis-generator-gui生成项目模板
2.配置yml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/lctest?useSSL=false&serverTimezone=UTC
username: root
password: 123456
mybatis:
mapper-locations: classpath:mapper/*.xml
3.启动类加入@MapperScan("com.lc.test.mapper")
启动看看