package com.gyee.wisdom.dao.sql.alarm.Entity;

import com.gyee.wisdom.common.data.ToData;
import com.gyee.wisdom.common.data.alarm.AlertRule;
import com.gyee.wisdom.common.data.alarm.ScadaBJ;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

@Data
@Entity
@NoArgsConstructor
@Table(name = "scadabj")
public class ScadaBJEntity implements ToData<ScadaBJ>,Serializable{
    private static final long serialVersionUID = -8348826240826071549L;
    @Id
    @Column(name = "id")
    private int id;
    @Column(name = "pointkey")
    private String pointkey;   //名称
    @Column(name = "description")
    private String description;    //描述
    @Column(name = "rank")
    private String rank;      //级别
    @Column(name = "enabled")
    private boolean enabled;  //是否启用
    @Column(name = "category1")
    private String category1;      //报警类别
    @Column(name = "category2")
    private String category2;      //报警类别
    @Column(name = "category3")
    private String category3;      //报警类别
    @Column(name = "category4")
    private String category4;      //报警类别
    @Column(name = "stationid")
    private String stationId;    //场站
    @Column(name = "deviceid")
    private String deviceId;    //场站
    @Column(name = "alarmtype")
    private int alarmType;    //报警方式

    @Override
    public ScadaBJ toData() {
        ScadaBJ obj = new ScadaBJ();
        BeanUtils.copyProperties(this, obj);
        return obj;
    }
}
