package com.jiayue.insu.incloud.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * Record 数据记录
 *
 * @author yh
 * @version 1.0
 * @since 2018/12/7 16:22
 */
@TableName(value = "in_record")
@Data
public class Record {

    @TableId(type = IdType.ASSIGN_UUID)
    private String id;
    /**
     *场站标识
     */
    private String stationCode;
    /**
     *一体化公司标识
     */
    private String inCode;
    /**
     *日志类型
     */
    private String type;
    /**
     *日志内容
     */
    private String content;
    /**
     *时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime time;
    /**
     *创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     *状态
     */
    private String state;
    /**
     *状态 描述
     */
    private String stateContent;


    @TableField( exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @TableField( exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    /**
     * 无参构造函数
     */
    public Record(){

    }

    /**
     * 初始化Record
     * @param type
     * @param inCode
     * @param stationCode
     * @param content
     * @param time
     * @param createTime
     * @param state
     * @param stateContent
     */
    public Record(String type,String inCode,String stationCode,String content,LocalDateTime time,LocalDateTime createTime,String state,String stateContent){
        this.type = type;
        this.inCode = inCode;
        this.stationCode = stationCode;
        this.content = content;
        this.time = time;
        this.createTime = createTime;
        this.state = state;
        this.stateContent = stateContent;
    }

}
