package com.njcn.process.pojo.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDateTime;


import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 
 * </p>
 *
 * @author cdf
 * @since 2024-10-30
 */
@Data
@TableName("supv_plan_rel")
public class SupvPlanRel {

    private static final long serialVersionUID = 1L;

    @TableId
    private String objId;

    @NotBlank(message = "计划id不可为空")
    private String planId;

    /**
     * 关联对象类型
     */
    @NotBlank(message = "关联对象类型不可为空")
    private String relObjType;

    private String relObjId;

    @NotBlank(message = "对象名称不可为空")
    private String relObjName;

    private Timestamp createTimes;

    @TableField(exist = false)
    private Long createTime;

    private Timestamp updateTimes;

    @TableField(exist = false)
    private Long  updateTime;

    private String isDelete;

    private Timestamp deleteTimes;

    @TableField(exist = false)
    private Long deleteTime;



    public void prepareForSerialization() {
        this.createTime = (this.createTimes != null) ? this.createTimes.getTime() : null;
        this.updateTime = (this.updateTimes != null) ? this.updateTimes.getTime() : null;
        this.deleteTime = (this.deleteTimes != null) ? this.deleteTimes.getTime() : null;
    }


}
