原因: mybatis_plus 默认会使用 “id” 为主键字段
解决:加上@TableId(value =“数据库你的主键字段”)注解即可
例如我的是product_id为主键
public class ProductInfo implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value ="product_id")
private String productId;
private Integer categoryType;
private Date createTime;
}
有帮助的朋友麻烦点个赞!!!