package com.gyee.wisdom.dao.sql.alarm.Entity;
import com.gyee.wisdom.common.data.ToData;
import com.gyee.wisdom.common.data.alarm.Warningrecords;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Data
@Entity
@NoArgsConstructor
@Table(name="warningrecords")
public class WarningrecordsEntity implements ToData<Warningrecords>, Serializable {
  private static final long serialVersionUID = 7086505699466420713L;
  @Id
  @Column(name = "id")
//  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "NXFD_WARNINGRECORDS")
//  @SequenceGenerator(name = "NXFD_WARNINGRECORDS", sequenceName = "NXFD_WARNINGRECORDS")
  private Long id;
  @Column(name = "windpowerstationid")
  private String windpowerstationid;
  @Column(name = "windturbineid")
  private String windturbineid;
  @Column(name = "warningid")
  private String warningid;
  @Column(name = "warningtime")
  private Date warningtime;
  @Column(name = "isconfirm")
  private String isconfirm;
  @Column(name = "ishandle")
  private String ishandle;
  @Column(name = "handle")
  private String handle;
  @Column(name = "shutdowneventid")
  private String shutdowneventid;
  @Column(name = "levelid")
  private String levelid;
  @Column(name = "wtaiid")
  private String wtaiid;
  @Column(name = "durationhour")
  private String durationhour;
  @Column(name = "isfilter")
  private String isfilter;

  @Override
  public Warningrecords toData() {
    Warningrecords warningrecords = new Warningrecords();
    BeanUtils.copyProperties(this,warningrecords);
    return warningrecords;
  }
  public WarningrecordsEntity(Warningrecords warningrecords) {
    //this.id=warningrecords.getId();
    this.windpowerstationid = warningrecords.getWindpowerstationid();
    this.windturbineid = warningrecords.getWindturbineid();
    this.warningid = warningrecords.getWarningid();
    this.warningtime = warningrecords.getWarningtime();
    this.isconfirm = warningrecords.getIsconfirm();
    this.ishandle = warningrecords.getIshandle();
    this.handle = warningrecords.getHandle();
    this.shutdowneventid = warningrecords.getShutdowneventid();
    this.levelid = warningrecords.getLevelid();
    this.wtaiid = warningrecords.getWtaiid();
    this.durationhour = warningrecords.getDurationhour();
    this.isfilter = warningrecords.getIsfilter();
  }
}
