mybatisplus设置属性值为 null,不生效解决方案
在实体类对应字段上,添加 注解 @TableField(fill = FieldFill.INSERT_UPDATE)
或
@TableField(updateStrategy = FieldStrategy.IGNORED )
@TableField(insertStrategy = FieldStrategy.IGNORED ) 组合使用
如下:
@TableName("数据库表名")
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class CheckParent {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
//点检项信息补全提示
@TableField(fill = FieldFill.INSERT_UPDATE)
private String tips;
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private LocalDateTime createTime;
}