@TableName(value = "tbl_employee")是设置类别名与数据库表名一致。
2.@TableId(value = "id",type = IdType.AUTO)设置主键自增,value =”列名”,type = IdType.AUTO自增。
```java
package com.wzy.pojo;
import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; import lombok.*;
@AllArgsConstructor//全参构造方法 @NoArgsConstructor//无参构造方法 @ToString//toString方法 @Getter//get方法 @Setter//set方法 @TableName(value = “tbl_employee”)//起别名 public class Employees { @TableId(value = “id”,type = IdType.AUTO)//设置id为自增 private Integer id; private String lastName; private String email; private Integer gender; private Integer age;
}
```
