MyBatis Plus 只插入只有自增id字段的表

mybatis plus技巧,插入数据时,怎么插入自定义的id信息,不走自增策略

在实体类中:

@TableId(value = "id", type = IdType.AUTO)
private Integer id;

改成

@TableId(value = "id", type = IdType.INPUT)
private Integer id;

posted on 2021-06-15 10:20  二两老酒  阅读(123)  评论(0编辑  收藏  举报

导航