Mybatis-Plus
快速入门方案(本篇使用mysql数据库进行测试)
基础配置即要准备的环境
- 数据库配置(application.yml) 注意cj5.7以上的数据库 不要忘记改库名密码呀
spring:
datasource:
username: root
password: root
url: jdbc:mysql://localhost:3306/mybatisplus?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=Asia/Shanghai
driver-class-name: com.mysql.cj.jdbc.Driver
- maven(pom.xml的依赖管理)
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
//主要的包包
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.3.1.tmp</version>
</dependency>
//代码生成的包包
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.3.1.tmp</version>
</dependency>
//生成摸板的包包
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.2</version>
</dependency>
//数据库连接的包包
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-c