package com.gyee.wisdom.dao.sql.power.entity;

import com.gyee.wisdom.common.data.ToData;
import com.gyee.wisdom.common.data.power.Status8Snap;
import com.gyee.wisdom.common.data.power.WindturbinePowerCurvefitting;
import com.gyee.wisdom.dao.sql.ModelConstants;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

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

@Data
@NoArgsConstructor
@ToString
@EqualsAndHashCode()
@Entity
@Table(name = "status8snap")
public class Status8SnapEntity implements ToData<Status8Snap> {

    @Id
    @Column(name = "wtid")
    private String wtId;
    @Column(name = "ts")
    private long ts;
    @Column(name = "status")
    private int status;


    public Status8SnapEntity(Status8Snap ss) {
        this.wtId = ss.getWtId();
        this.ts = ss.getTs();
        this.status = ss.getStatus();
    }

    public Status8Snap toData() {
        Status8Snap ss = new Status8Snap();
        ss.setWtId(this.wtId);
        ss.setTs(this.ts);
        ss.setStatus(this.status);

        return ss;
    }
}
