package org.springblade.modules.nh.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springblade.core.mp.base.BaseEntity;

import java.io.Serializable;
import java.util.Date;

/**
 * 逆变器数据表 实体类
 *
 * @author AlexWang
 * @since 2024-05-31
 */
@Data
@TableName("nh_inverter_data")
@Schema(description = "InverterData对象")
public class InverterDataEntity implements Serializable {

	private static final long serialVersionUID = 1L;
	/**
	 * 主键
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	@Schema(description = "主键")
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	private Long id;

	/**
	 * 设备ID
	 */
	@Schema(description = "设备ID")
	private Long deviceId;

	@Schema(description = "设备ID")
	private String outDeviceId;

	@Schema(description = "设备SN")
	private String sn;
	/**
	 * 输出功率
	 */
	@Schema(description = "输出功率")
	private BigDecimal pac;
	/**
	 * 发电小时数
	 */
	@Schema(description = "发电小时数")
	private BigDecimal pwHour;
	/**
	 * 实际安装功率
	 */
	@Schema(description = "实际安装功率")
	private BigDecimal realPower;
	/**
	 * 装机容量
	 */
	@Schema(description = "装机容量")
	private BigDecimal power;
	/**
	 * 当日发电量
	 */
	@Schema(description = "当日发电量")
	private BigDecimal etd;
	/**
	 * 当月发电量
	 */
	@Schema(description = "当月发电量")
	private BigDecimal etm;
	/**
	 * 累计发电量
	 */
	@Schema(description = "累计发电量")
	private BigDecimal eto;
	/**
	 * 当年发电量
	 */
	@Schema(description = "当年发电量")
	private BigDecimal ety;
	/**
	 * 直流发电功率
	 */
	@Schema(description = "直流发电功率")
	private BigDecimal dcPac;
	/**
	 * 采集器SN
	 */
	@Schema(description = "采集器SN")
	private String collectorSn;
	/**
	 * 逆变器无功功率
	 */
	@Schema(description = "逆变器无功功率")
	private BigDecimal reactivePower;
	/**
	 * 逆变器无功功率单位
	 */
	@Schema(description = "逆变器无功功率单位")
	private String reactivePowerStr;
	/**
	 * 逆变器视在功率
	 */
	@Schema(description = "逆变器视在功率")
	private BigDecimal apparentPower;
	/**
	 * 逆变器视在功率单位
	 */
	@Schema(description = "逆变器视在功率单位")
	private String apparentPowerStr;
	/**
	 * 电网频率hz
	 */
	@Schema(description = "电网频率hz")
	private BigDecimal fac;
	/**
	 * pv直流电压存贮格式如下（220:10|220:10）
	 */
	@Schema(description = "pv直流电压存贮格式如下（220:10|220:10）")
	private String pvModules;
	/**
	 * mppt存贮格式如下（220:10|220:10）
	 */
	@Schema(description = "mppt存贮格式如下（220:10|220:10）")
	private String mpptModules;
	/**
	 * uvw(220:10:55|220:10:55|220:10:55)
	 */
	@Schema(description = "uvw(220:10:55|220:10:55|220:10:55)")
	private String uvwModules;
	/**
	 * 温度
	 */
	@Schema(description = "温度")
	private BigDecimal temperature;

	@Schema(description = "数据同步时间")
	private Date syncTime;

	@Schema(description = "输出因素")
	private BigDecimal powerFactor;

	public void init(){
		this.pac = BigDecimal.ZERO;
		this.pwHour = BigDecimal.ZERO;
		this.powerFactor = BigDecimal.ZERO;
		this.apparentPower = BigDecimal.ZERO;
		this.power = BigDecimal.ZERO;
		this.realPower = BigDecimal.ZERO;
		this.dcPac = BigDecimal.ZERO;
		this.etd = BigDecimal.ZERO;
		this.etm = BigDecimal.ZERO;
		this.ety = BigDecimal.ZERO;
		this.eto = BigDecimal.ZERO;
		this.temperature = BigDecimal.ZERO;
		this.fac = BigDecimal.ZERO;
	}
}
