package com.yeejoin.amos.boot.module.hygf.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 按年统计
 *
 * @author system_generator
 * @date 2023-09-20
 */
@Data
@Accessors(chain = true)
@TableName("td_hygf_station_power_year")
public class YearPower  {

    private static final long serialVersionUID = 1L;
    @TableId(value = "created_time")
    private Long createdTime;
    /**
     * 第三方电站id
     */
	@TableField("third_station_id")
    private String thirdStationId;

    /**
     * 日期
     */
	@TableField("month")
    private String month;

    /**
     * 年月
     */
	@TableField("year")
    private String year;

    /**
     * 平均功率
     */
	@TableField("power")
    private Double power;


    public YearPower() throws InterruptedException{

        Thread.sleep(0L,1);
        this.createdTime=System.currentTimeMillis();
        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM");
        String formattedDate = now.format(formatter);
        this.month = formattedDate;

        DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("YYYY");
        String formattedDate1 = now.format(formatter1);
        this.year = formattedDate1;

    }
}
