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.lang.Double;
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.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseEntity;

import java.io.Serializable;

/**
 * 低效电站设置 实体类
 *
 * @author AlexWang
 * @since 2024-06-14
 */
@Data
@TableName("nh_inefficient_setting")
@Schema(description = "InefficientSetting对象")
public class InefficientSettingEntity extends BaseEntity {


	/**
	 * 资方编码
	 */
	@Schema(description = "资方编码")
	private String capitalCode;
	/**
	 * 资方名称
	 */
	@Schema(description = "资方名称")
	private String capitalName;
	/**
	 * 方案类型
	 */
	@Schema(description = "方案类型")
	private Integer planType;
	/**
	 * 方案名称
	 */
	@Schema(description = "方案名称")
	private String planName;
	/**
	 * 省份
	 */
	@Schema(description = "省份")
	private String province;
	/**
	 * 多个城市
	 */
	@Schema(description = "多个城市")
	private String citys;
	/**
	 * 备案方式
	 */
	@Schema(description = "备案方式")
	private Integer recordType;
	/**
	 * 客户类型
	 */
	@Schema(description = "客户类型")
	private Integer customerType;
	/**
	 * 打点位置
	 */
	@Schema(description = "打点位置")
	private String dotPosition;
	/**
	 * 1月
	 */
	@Schema(description = "1月")
	private Double guardHourM1;
	/**
	 * 2月
	 */
	@Schema(description = "2月")
	private Double guardHourM2;
	/**
	 * 3月
	 */
	@Schema(description = "3月")
	private Double guardHourM3;
	/**
	 * 4月
	 */
	@Schema(description = "4月")
	private Double guardHourM4;
	/**
	 * 5月
	 */
	@Schema(description = "5月")
	private Double guardHourM5;
	/**
	 * 6月
	 */
	@Schema(description = "6月")
	private Double guardHourM6;
	/**
	 * 7月
	 */
	@Schema(description = "7月")
	private Double guardHourM7;
	/**
	 * 8月
	 */
	@Schema(description = "8月")
	private Double guardHourM8;
	/**
	 * 9月
	 */
	@Schema(description = "9月")
	private Double guardHourM9;
	/**
	 * 10月
	 */
	@Schema(description = "10月")
	private Double guardHourM10;
	/**
	 * 11月
	 */
	@Schema(description = "11月")
	private Double guardHourM11;
	/**
	 * 12月
	 */
	@Schema(description = "12月")
	private Double guardHourM12;
	/**
	 * 合计
	 */
	@Schema(description = "合计")
	private Double guardHourTotal;

	/**
	 * 年份
	 */
	@Schema(description = "年份")
	private String year;

	public void calTotal(){
		//累加12个月的合计有效发电时间
		Double total = 0D;
		for(int i=1;i<=12;i++){
			Object val = CommonUtil.reflectGetField(this,"guardHourM"+i);
			if(val!=null){
				total += (Double) val;
			}
		}
		this.guardHourTotal = total;
	}

}
