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_month_power")
public class MonthPower {

    private static final long serialVersionUID = 1L;





    @TableId(value = "created_time")
    private Long createdTime;

    /**
     * 第三方电站id
     */
	@TableField("tation_id")
    private String thirdStationId;

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

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

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



    public MonthPower()throws InterruptedException {

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

        DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("YYYY-MM");
        String formattedDate1 = now.format(formatter1);
        this.yearMonth = formattedDate1;

    }




}
