package com.gyee.wisdom.alarm.schedule.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

@Data
@TableName("EarlyWarnScore")
public class EarlyWarnScore implements Serializable{

    @TableId("id")
    private String id;
    @TableField("windturbineid")
    private String windturbineid;
    @TableField("statdate")
    private Date statdate;
    @TableField("totalscore")
    private double totalscore;
    @TableField("sensorscore")
    private double sensorscore;
    @TableField("partsscore")
    private double partsscore;
    @TableField("controlscore")
    private double controlscore;
    @TableField("performancescore")
    private double performancescore;
    @TableField("otherscore")
    private double otherscore;
    @TableField("cfxtscore")
    private double cfxtscore;
    @TableField("fdjscore")
    private double fdjscore;
    @TableField("clxscore")
    private double clxscore;
    @TableField("zkgscore")
    private double zkgscore;
    @TableField("jcscore")
    private double jcscore;
    @TableField("bjxtscore")
    private double bjxtscore;
    @TableField("cdlscore")
    private double cdlscore;

    public String getMaxParts() {
        List<Early> list = new ArrayList<>();
        list.add(new Early("变桨系统",bjxtscore));
        list.add(new Early("发电机",fdjscore));
        list.add(new Early("轴承",cdlscore));
        list.add(new Early("齿轮箱",clxscore));
        list.add(new Early("主控柜",zkgscore));
        list.add(new Early("机舱",jcscore));
        list.add(new Early("测风系统",cfxtscore));
        Collections.sort(list);
        Collections.reverse(list);
        return list.get(0).getName();
    }

    public String getMaxEarlyType() {
        List<Early> list = new ArrayList<>();
        list.add(new Early("控制参数",controlscore));
        list.add(new Early("传感器异常",sensorscore));
        list.add(new Early("零部件隐患",partsscore));
        list.add(new Early("性能下降",performancescore));
        list.add(new Early("其它",otherscore));
        Collections.sort(list);
        Collections.reverse(list);
        return list.get(0).getName();
    }



}
