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.util.Date;
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;

/**
 * 设备管理 实体类
 *
 * @author AlexWang
 * @since 2024-05-31
 */
@Data
@TableName("nh_device")
@Schema(description = "Device对象")
public class DeviceEntity extends BaseEntity {

	/**
	 * 所属电站ID
	 */
	@Schema(description = "所属电站ID")
	private Long stationId;
	/**
	 * 内部设备ID
	 */
	@Schema(description = "内部设备ID")
	private String innerStationId;
	/**
	 * 内部设备ID
	 */
	@Schema(description = "内部设备ID")
	private String innerDeviceId;

	@Schema(description = "外部电站ID")
	private String outStationId;
	/**
	 * 外部逆变器ID
	 */
	@Schema(description = "外部逆变器ID")
	private String outDeviceId;
	/**
	 * 设备品牌0：锦狼，1.aiswei 2.goodwe
	 */
	@Schema(description = "设备品牌0：锦狼，1.aiswei 2.goodwe")
	private String brand;
	/**
	 * 设备类型（1、逆变器2、通讯棒）
	 */
	@Schema(description = "设备类型（1、逆变器2、通讯棒）")
	private Integer type;
	/**
	 * 设备名称
	 */
	@Schema(description = "设备名称")
	private String name;
	/**
	 * 设备型号
	 */
	@Schema(description = "设备型号")
	private String mods;
	/**
	 * 设备sn码
	 */
	@Schema(description = "设备sn码")
	private String sn;
	/**
	 * 设备条码
	 */
	@Schema(description = "设备条码")
	private String barCode;
	/**
	 * 质保状态（1、在保 0过保）
	 */
	@Schema(description = "质保状态（1、在保 0过保）")
	private Integer warrantyFlag;
	/**
	 * 质保到期时间
	 */
	@Schema(description = "质保到期时间")
	private Date warrantyExpires;
	/**
	 * 错误码
	 */
	@Schema(description = "错误码")
	private String faultCode;

	@Schema(description = "故障码名称")
	private String alarmName;

	public void init(){
		this.warrantyFlag = 0;
		this.type = 1;
	}
}
