package cn.wise.sc.energy.power.plant.business.domain;

import cn.wise.sc.energy.power.plant.business.domain.vo.DeviceInfoVo;
import cn.wise.sc.energy.power.plant.business.domain.vo.EntityVo;
import cn.wise.sc.energy.power.plant.business.domain.vo.EventInfoVo;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @description: 事件记录
 * @author: qh
 * @create: 2020-09-03 09:36
 **/
@Data
@Entity
@Table(name = "eventinfo")
public class EventInfo extends AbstractEntity<Long> {

    @Override
    public EntityVo toVo(){
        EventInfoVo entityVo = new EventInfoVo();
        BeanUtils.copyProperties(this,entityVo);
        return entityVo;
    }

    @Id
    private Long id;

    /**
     * 记录时间
     */
    @Column(name = "valuetime")
    private long valueTime;

    /**
     * 监测特征所属电站的标识
     */
    @Column(name = "plantid")
    private String plantId;

    /**
     * 监测特征所属设备的标识
     */
    @Column(name = "deviceid")
    private String deviceId;

    /**监测特征所属监测单元标识
     *
     */
    @Column(name = "unitcodeid")
    private String unitCodeId;

    /**
     * 监测特征唯一标识编码(KKS编码
     */
    @Column(name = "kkscode")
    private String kKSCode;

    /**
     * 实际测量值
     */
    @Column(name = "value")
    private Float value;

    /**
     * 信号状态：0-正常、1-无效、2-预警报警、
     * 3-高报警、4-高高报警、5-上趋势报警、6-下趋势报警
     */
    @Column(name = "alertstat")
    private Integer alertStat;

    /**
     * 特征参数保护下限值
     */
    @Column(name = "alertminvalue")
    private Float alertMinvalue;

    /**
     * 特征参数保护上限值
     */
    @Column(name = "alertmaxvalue")
    private Float alertMaxvalue;

    /**
     * 预警范围：0-范围内 1-范围外
     */
    @Column(name = "alertlimit")
    private Integer alertLimit;

    /**
     * 预警值设置来源 (角色或后台)
     */
    @Column(name = "altlimitusr")
    private String altLimitUsr;

    /**
     * 监测特征的物理单位，如 um/mm 等
     */
    @Column(name = "cpunit")
    private String cpUnit;

    /**
     * 事件状态：0-未处理  1-已处理
     */
    @Column(name = "eventinfo")
    private Integer eventInfo;

}
