mybatis-plus 设置主键自增

在实体类中添加@TableId注解:

@Data
public class DxApplication {
  @TableId(type = IdType.AUTO)
  private Long id;
  private String name;
  private Integer sort;

}

在navicat中设置id自动增长:

 

posted @ 2021-06-11 10:12  浅笑19  阅读(502)  评论(0编辑  收藏  举报