package com.jiayue.insu.inclientqn.entity;

import com.baomidou.mybatisplus.annotation.IdType;
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 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 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;

    /**
     * 场站编码
     */
    String stationCode;

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

    }

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

}
