package com.jiayue.ipfcst.common.data.entity;

import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
import com.jiayue.ipfcst.common.data.constant.enums.FileStatusEnum;
import com.jiayue.ipfcst.common.data.constant.enums.FileTypeEnum;
import com.jiayue.ipfcst.common.data.constant.enums.UploadProtocolEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.core.annotation.Order;

import javax.persistence.*;

/**
 * 上报文件日志
 *
 * @author xsl
 * @version 3.0
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(indexes = {@Index(columnList = "createTime",name="ufl_ct_idx")})
public class UploadFileLog extends AbstractBaseEntity {

    /**
     * BACKUPA存生成文件所属时刻
     */

    private static final long serialVersionUID = 1L;

    @Id
    @Order(1)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
    private Integer id;

    /**
     * 上报对象主键ID
     */
    @Column
    private Integer uploadObjectId;

    /**
     * 上报对象名称
     */
    @Column
    private String uploadObjectName;

    /**
     * 上报对象编号
     */
    @Column
    private String uploadObjectNo;

    /**
     * 文件名称
     */
    @Column
    private String fileName;

    /**
     * 文件类型
     */
    @Column
    @Enumerated(EnumType.STRING)
    private FileTypeEnum fileTypeEnum;

    /**
     * 文件状态
     */
    @Column
    @Enumerated(EnumType.STRING)
    private FileStatusEnum fileStatusEnum;

    /**
     * 上报协议
     */
    @Column
    @Enumerated(EnumType.STRING)
    private UploadProtocolEnum uploadProtocolEnum;

    /**
     * 上报次数
     */
    @Column
    private Integer uploadCounter;

    /**
     * 文件备注
     */
    @Column
    private String fileRemarks;

    /**
     * 上报设备ID(指定气象站或测风塔)
     */
    @Column
    private String uploadEquipmentID;

    /**
     * 上报文件截止时间
     */
    @Column
    private Long uploadFileEndTime;

    /**
     * 上报文件截止时间
     * backupA 为补报时间，时间字符串
     */

}
