package com.muyu.warning.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.annotation.Excel;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;

/**
 * 预警日志对象 warn_logs
 *
 * @author muyu
 * @date 2024-09-20
 */

@Data
@Setter
@Getter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName("warn_logs")
public class WarnLogs {
    private static final long serialVersionUID = 1L;

    /** 预警日志id */
    @TableId( type = IdType.AUTO)
    private Long id;

    /** 车辆vin码 */
    @Excel(name = "车辆vin码")
    private String vin;

    /** 规则id */
    @Excel(name = "规则id")
    private Long warnRuleId;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 最大值 */
    @Excel(name = "最大值")
    private Long maxValue;

    /** 最小值 */
    @Excel(name = "最小值")
    private Long minValue;

    /** 平均值 */
    @Excel(name = "平均值")
    private Long avgValue;

    /** 中位数 */
    @Excel(name = "中位数")
    private Long medianValue;

    /** 是否发送预警 */
    @Excel(name = "是否发送预警")
    private Long status;



    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("vin", getVin())
            .append("warnRuleId", getWarnRuleId())
            .append("startTime", getStartTime())
            .append("endTime", getEndTime())
            .append("maxValue", getMaxValue())
            .append("minValue", getMinValue())
            .append("avgValue", getAvgValue())
            .append("medianValue", getMedianValue())
            .append("status", getStatus())
            .toString();
    }
}
