Mybatis-Plus常用注解

时间:2022-10-16 09:58:17


@TableName 说明表名


@TableName("sys_user")
public class User {
private Long id;
private String name;
private Integer age;
private String email;
}



​@TableId​

主键id字段上使用



​@TableField​​ 数据库字段名

@TableName("sys_user")
public class User {
@TableId
private Long id;
@TableField("nickname")
private String name;
private Integer age;
private String email;
}


更多参考

​https://baomidou.com/pages/223848/#idtype​