package com.gyee.wisdom.dao.sql.alarm.Entity;
import com.gyee.wisdom.common.data.ToData;
import com.gyee.wisdom.common.data.alarm.WindturbineTestingpointDi;
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="windturbinetestingpointdi")
public class WindturbineTestingpointDiEntity implements ToData<WindturbineTestingpointDi>,Serializable {

    private static final long serialVersionUID = 7484745276334585848L;
    @Id
    @Column(name = "id")
    private String id;
    @Column(name = "code")
    private String code;
    @Column(name = "name")
    private String name;
    @Column(name = "model")
    private String model;
    @Column(name = "valueunit")
    private String valueunit;
    @Column(name = "englishname")
    private String englishName;
    @Column(name = "typeid")
    private String typeId;
    @Column(name = "modelid")
    private String modelId;
    @Column(name = "maxval")
    private Double maxval;
    @Column(name = "minval")
    private Double minval;
    @Column(name = "reasonablemaxval")
    private Double reasonableMaxVal;
    @Column(name = "reasonableminval")
    private Double reasonableMinVal;
    @Column(name = "windturbineid")
    private String windturbineId;
    @Column(name = "uniformcode")
    private String uniformcode;
    @Column(name = "shortid")
    private String shortId;
    @Column(name = "longid")
    private String longId;
    @Column(name = "windpowerstationid")
    private String windpowerstationId;
    @Column(name = "realtimeid")
    private String realTimeId;

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


    public WindturbineTestingpointDiEntity(WindturbineTestingpointDi windturbineTestingpointDi) {
            this.id = windturbineTestingpointDi.getId();
            this.code = windturbineTestingpointDi.getCode();
            this.name = windturbineTestingpointDi.getName();
            this.model = windturbineTestingpointDi.getModel();
            this.valueunit = windturbineTestingpointDi.getValueunit();
            this.englishName = windturbineTestingpointDi.getEnglishName();
            this.typeId = windturbineTestingpointDi.getTypeId();
            this.modelId = windturbineTestingpointDi.getModelId();
            this.maxval = windturbineTestingpointDi.getMaxval();
            this.minval = windturbineTestingpointDi.getMinval();
            this.reasonableMaxVal = windturbineTestingpointDi.getReasonableMaxVal();
            this.reasonableMinVal = windturbineTestingpointDi.getReasonableMinVal();
            this.windturbineId =windturbineTestingpointDi.getWindturbineId();
            this.uniformcode = windturbineTestingpointDi.getUniformcode();
            this.shortId = windturbineTestingpointDi.getShortId();
            this.longId = windturbineTestingpointDi.getLongId();
            this.windpowerstationId = windturbineTestingpointDi.getWindpowerstationId();
            this.realTimeId = windturbineTestingpointDi.getRealTimeId();
    }
}
