踩坑:Mybatis Plus 逻辑删除 @TableLogic
@TableLogic
被标识的实体 Dao 对象字段会自动映射逻辑删除值
/**
* 是否已删除
*/
@NotNull
@TableLogic(value = "0", delval = "1")
@TableField(value = "is_deleted")
private Boolean hasDeleted;
坑 1:update()
方法无法更新被标记字段
当把实体的hasDeleted
属性设置为 1,然后调用update()
,会发现值并没有被更新