Mybatis-plus实现简单增删改查
本次博客内容,主要是基于spring boot,用Mybatis-plus 来实现简单的增删改查,主要分为mp基础框架搭建和利用苞米豆已近封装好的方法来实现。
搭建mp框架
a) 建立数据库,数据表
b) 创建一个spring boot项目
c) 导入依赖 pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-star