1. /**<br /> * @TableId:<br /> * **value**:指定表中的主键列的列名,如果实体属性名与列名一致,可以省略不指定。<br /> * **type**:指定主键策略。IdType.AUTO为自增<br /> */<br />
    package com.wzy.pojo;
    
    import com.baomidou.mybatisplus.annotations.TableField;
    import com.baomidou.mybatisplus.annotations.TableId;
    import com.baomidou.mybatisplus.annotations.TableName;
    import com.baomidou.mybatisplus.enums.IdType;
    import lombok.*;
    
    @AllArgsConstructor
    @NoArgsConstructor
    @ToString
    @Getter
    @Setter
    @TableName(value = "tbl_employee")//起别名
    public class Employees {
        /**
         * @TableId:
         *      value:指定表中的主键列的列名,如果实体属性名与列名一致,可以省略不指定。
         *      type:指定主键策略。IdType.AUTO为自增
         */
         @TableId(value = "id",type = IdType.AUTO)
         private Integer id;
         @TableField(value = "last_name")
         private String lastName;
         private String email;
         private Integer gender;
         private Integer age;
    }