官网地址:https://mp.baomidou.com

一. 添加pom依赖

  1. <dependency>
  2. <groupId>com.baomidou</groupId>
  3. <artifactId>mybatis-plus-boot-starter</artifactId>
  4. <version>3.3.2</version>
  5. </dependency>

二. 实体类

  1. //如果表名和实体类名不一致需要做映射(TableName)
  2. @TableName("t_users")
  3. public class Users {
  4. private String uuid;
  5. private String username;
  6. private String password;

注意:生成getset toString方法。

三. Mapper

  1. @Mapper
  2. public interface LoginMapper extends BaseMapper<Users> {
  3. }