一、创建项目
添加application.yml配置文件
添加启动类
在resources中添加mappers文件夹
在java中添加entity、dao、service、controller包
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://124.222.121.211:3306/page?characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Atrius.173
#mybatisPlus????
mybatis-plus:
mapper-locations: classpath:mappers/*.xml
type-aliases-package: com.example.pagedemo.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
二、在pom.xml中添加依赖
<!-- MyBatisPlus依赖-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.1</version>
</dependency>
<!--LomBok依赖-->
<dependency>
<groupId>