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 lombok.Data;
import org.springframework.beans.BeanUtils;

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

/**
 * @description: 设备信息
 * @author: qh
 * @create: 2020-07-14 09:41
 **/
@Data
@Entity
@Table(name = "deviceinfo")
public class DeviceInfo extends AbstractEntity<String> {

    @Override
    public EntityVo toVo(){
        DeviceInfoVo deviceInfoVo = new DeviceInfoVo();
        BeanUtils.copyProperties(this,deviceInfoVo);
        return deviceInfoVo;
    }
    /**
     * 设备所在电站的标识
     */
    @Column(name = "plantid")
    private String plantId;
    /**
     * 设备唯一标识编码如：C0A00101，该标识用于与设备配置信息其他表的关联
     */
    @Id
    @Column(name = "deviceid")
    private String deviceId;
    /**
     * 设备真是名称
     */
    @Column(name = "devicename")
    private String deviceName;
    /**
     * 设备分类, 发电机、汽轮机、水轮机等
     */
    @Column(name = "devicetype")
    private String deviceType;
    /**
     * 设备制造厂
     */
    @Column(name = "manufacture")
    private String manufacture;
    /**
     * 设备编码
     */
    @Column(name = "devicecode")
    private String deviceCode;
    /**
     * 设备静态参数描述；以Json 格式存储，如 {"ratepower":"300MW","raterpm":"3000r/min"}
     */
    @Lob
    @Column(name = "deviceparam")
    private String deviceParam;

    @Override
    public String getId() {
        return getDeviceId();
    }
}
