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 com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

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

    private static final long serialVersionUID = 1L;
    @TableId(value = "created_time")
    private Long createdTime;
    /**
     * 第三方电站id
     */
	@TableField("tation_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;

    }
}
