package com.mortals.xhx.module.stat.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.stat.model.vo.StatVo;
import lombok.Data;
/**
* 汇总统计实体对象
*
* @author zxfei
* @date 2024-07-02
*/
@Data
public class StatEntity extends StatVo {
    private static final long serialVersionUID = 1L;

    /**
    * 站点Id
    */
    private Long siteId;
    /**
    * 站点编码
    */
    private String siteCode;
    /**
    * 站点名称
    */
    private String siteName;
    /**
    * 数量
    */
    private Integer count;
    /**
    * 年
    */
    private Integer year;
    /**
    * 月
    */
    private Integer month;
    /**
    * 日
    */
    private Integer day;
    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof StatEntity) {
            StatEntity tmp = (StatEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
            this.siteId = null;
            this.siteCode = "";
            this.siteName = "";
            this.count = 0;
            this.year = DateUtil.year(new Date());
            this.month = DateUtil.month(new Date())+1;
            this.day = DateUtil.dayOfMonth(new Date());
    }
}