package com.unis.base.common.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 与仓房记录表合并
 * @see  DCfxxsjyUpdateLogVO
 * @author by PIG
 * 2023/7/20 14
 */
@ApiModel("油罐业务对象")
@AllArgsConstructor(access = AccessLevel.PACKAGE)
@NoArgsConstructor
@Builder
@Data
//@Table(name = "d_ygxxsjy_update_log")
public class OiltankUpdateLogVO implements Serializable {

    private static final long serialVersionUID = -1;

    private Long fid;
    @ApiModelProperty(value="数据状态")
    private Integer status = 0;

    /**
     * 创建人
     */
    @ApiModelProperty(value="创建者")
    private String creator;

    /**
     * 创建人编号
     */
    @ApiModelProperty(value="创建人编号")
    private String creatorCode;

    /**
     * 创建时间
     */
    @JSONField(format="yyyy-MM-dd HH:mm")
    @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value="创建时间")
    private Date createDate;

    /**
     * 刷新时间
     */
    @JSONField(format="yyyy-MM-dd HH:mm")
    @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value="刷新时间")
    @Column(name = "refresh_time")
    private Date refreshTime;

    /**
     * 刷新人
     */
    @ApiModelProperty(value="更新人")
    private String refresher;

    /**
     * 刷新人编号
     */
    @ApiModelProperty(value="更新人编号")
    @Column(name = "refresher_code")
    private String refresherCode;


    @Column(name = "tyshxydm")
    private String tyshxydm;
    @Column(name = "update_col")
    private String updateCol;
    @Column(name = "before_data")
    private String beforeData;
    @Column(name = "after_data")
    private String afterData;
    @Column(name = "data_ver")
    private Integer dataVer;
    /**  备注 */
    @ApiModelProperty(value="备注")
    private String remark;

    private String qymc;
    @ApiModelProperty(value = "")
    private String ygdm;
    private String ygmc;

    @ApiModelProperty(value = "变更原因")
    @Column(name = "change_reason")
    private String changeReason;

    public OiltankUpdateLogVO(String tyshxydm, String ygdm, String ygmc,
                               String updateCol, String beforeData, String afterData) {
        this.tyshxydm = tyshxydm;
        this.updateCol = updateCol;
        this.afterData = afterData;
        this.beforeData = beforeData;
        this.ygdm = ygdm;
        this.ygmc = ygmc;

        this.status = 0;
        this.createDate = new Date();
        this.refreshTime = new Date();
    }

    public enum COL{
        /** 油罐状态*/
        YGZT("油罐状态");

        @Getter
        private String name;

        COL(String name){
            this.name = name;
        }
        public boolean equName(String name){
            return this.name.equals(name);
        }
    }
}
