package cn.wise.sc.energy.power.plant.business.domain;

import cn.wise.sc.energy.power.plant.business.domain.vo.EntityVo;
import cn.wise.sc.energy.power.plant.business.domain.vo.PlantInfoVo;
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 = "plantinfo")
public class PlantInfo extends AbstractEntity<String>{
    /**
     * 电站唯一标识
     */
    @Id
    @Column(name = "plantid")
    private String plantId;
    /**
     * 电站数据存放的数据库标识(保留)
     */
    @Column(name = "plantdbcode")
    private String plantCode;

    /**
     * 电站真真实名称
     */
    @Column(name = "plantname")
    private String plantName;
    /**
     * 电站所在国家
     */
    private String country;
    /**
     * 电站所在省份
     */
    private String province;
    /**
     * 电站所在纬度
     */
    private String latitude;
    /**
     * 电站所在经度
     */
    private String longitude;

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

    @Override
    public EntityVo toVo(){
        PlantInfoVo plantInfoVo = new PlantInfoVo();
        BeanUtils.copyProperties(this,plantInfoVo);
        return plantInfoVo;
    }
}
