package com.nantian.cloud.jljc.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.text.NumberFormat;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



/**
 * 报表1-3能耗指标表
 * @since 2020-09-16
 * @author stz
 */
@Data
@TableName("t_report_unitenergy")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "报表1-3能耗指标表")
public class TReportUnitenergy extends Model<TReportUnitenergy>{

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id")
    @ApiModelProperty(value = "主键id")
    private Long id;

    /**
     *  报表信息表id
     */
    @ApiModelProperty(value = "报表信息表id")
    private Long reportId;

    /**
     * 指标id
     */
    @ApiModelProperty(value = "指标id")
    private Long quotaId;

    /**
     * 指标名称
     */
    @ApiModelProperty(value = "指标名称")
    private String quotaName;

    /**
     * 指标单位
     */
    @ApiModelProperty(value = "指标单位")
    private String quotaUnit;

    /**
     * 子项单位
     */
    @ApiModelProperty(value = "子项单位")
    private String childUnit;

    /**
     * 母项单位
     */
    @ApiModelProperty(value = "母项单位")
    private String parentUnit;

    /**
     * 换算系数
     */
    @ApiModelProperty(value = "换算系数")
    private String ratio;

    /**
     * 代码
     */
    @ApiModelProperty(value = "代码")
    private String code;

    /**
     * 指标值
     */
    @ApiModelProperty(value = "指标值")
    private Double guidelineVal;

    /**
     * 子项值
     */
    @ApiModelProperty(value = "子项值")
    private Double childVal;

    /**
     * 母项值
     */
    @ApiModelProperty(value = "母项值")
    private Double parentVal;

    /**
     * 指标值
     */
    @ApiModelProperty(value = "上年指标值")
    @TableField(exist = false) //不是数据库表字段
    private Double prevGuidelineVal;

    /**
     * 子项值
     */
    @ApiModelProperty(value = "上年子项值")
    @TableField(exist = false) //不是数据库表字段
    private Double prevChildVal;

    /**
     * 母项值
     */
    @ApiModelProperty(value = "上年母项值")
    @TableField(exist = false) //不是数据库表字段
    private Double prevParentVal;

    /**
     * 国家（地区）限额
     */
    @ApiModelProperty(value = "国家（地区）限额")
    private String quotaLimit;

    /**
     * 影响指标变化因素的说明
     */
    @ApiModelProperty(value = "影响指标变化因素的说明")
    private String remarks;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private Integer userid;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 注销状态（1：未删除，4：已删除）
     */
    @ApiModelProperty(value = "注销状态（1：未删除，4：已删除）")
    private String delFlag;

    /**
     * 部门id
     */
    @ApiModelProperty(value = "部门id")
    private Integer deptId;

    /**
     * 主键值
     */
    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "TReportUnitenergy{" +
                "id=" + id +
                ", reportId=" + reportId +
                ", quotaName='" + quotaName + '\'' +
                ", quotaUnit='" + quotaUnit + '\'' +
                ", childUnit='" + childUnit + '\'' +
                ", parentUnit='" + parentUnit + '\'' +
                ", ratio='" + ratio + '\'' +
                ", code='" + code + '\'' +
                ", guidelineVal=" + big(guidelineVal) +
                ", childVal=" + big(childVal) +
                ", parentVal=" + big(parentVal) +
                ", prevGuidelineVal=" + big(prevGuidelineVal) +
                ", prevChildVal=" + big(prevChildVal) +
                ", prevParentVal=" + big(prevParentVal) +
                ", quotaLimit='" + quotaLimit + '\'' +
                ", remarks='" + remarks + '\'' +
                ", userid=" + userid +
                ", updateTime=" + updateTime +
                ", delFlag='" + delFlag + '\'' +
                ", deptId=" + deptId +
                '}';
    }

    private static String big(double d) {
        NumberFormat nf = NumberFormat.getInstance();
        nf.setGroupingUsed(false);
        return nf.format(d);
    }
}
