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-5项目表
 * @since 2020-09-16
 * @author stz
 */
@Data
@TableName("t_report_energy_project")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "报表1-5项目表")
public class TReportEnergyProject extends Model<TReportEnergyProject> {

    private static final long serialVersionUID = 1L;

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

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

    /**
     * 项目名称
     */
    @ApiModelProperty(value = "项目名称")
    private String name;

    /**
     * 主要改造内容
     */
    @ApiModelProperty(value = "主要改造内容")
    private String content;

    /**
     * 投资金额（万元）
     */
    @ApiModelProperty(value = "投资金额（万元）")
    private Float money;

    /**
     * 节能效果
     */
    @ApiModelProperty(value = "节能效果")
    private Float energySavingEffect;

    /**
     * 能源列表Json
     */
    @ApiModelProperty(value = "能源列表Json")
    private String energyJson;

    /**
     * 是否合同能源管理模式（1：是，2：否）
     */
    @ApiModelProperty(value = "是否合同能源管理模式（1：是，2：否）")
    private String status;

    /**
     * 项目进度
     */
    @ApiModelProperty(value = "项目进度")
    private String progress;

    /**
     * 审批部门
     */
    @ApiModelProperty(value = "审批部门")
    private String auditDepartment;

    /**
     * 用户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;


    /**
     * 项目类别
     */
    @ApiModelProperty(value = "项目类别")
    private String projectType;


    /**
     * 项目分类
     */
    @ApiModelProperty(value = "项目分类")
    private String pojectClassification;

    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    /**
     * 预计完成时间
     */
    @ApiModelProperty(value = "预计完成时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;


    @ApiModelProperty(value = "年份")
    @TableField(exist = false)
    private String year;

    @ApiModelProperty(value = "企业名称")
    @TableField(exist = false)
    private String enterpriseName;

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

    @Override
    public String toString() {
        return "TReportEnergyProject{" +
                "id=" + id +
                ", reportId=" + reportId +
                ", name='" + name + '\'' +
                ", content='" + content + '\'' +
                ", money=" + big(money) +
                ", energySavingEffect=" + big(energySavingEffect) +
                ", energyJson='" + energyJson + '\'' +
                ", status='" + status + '\'' +
                ", progress='" + progress + '\'' +
                ", auditDepartment='" + auditDepartment + '\'' +
                ", userid=" + userid +
                ", updateTime=" + updateTime +
                ", delFlag='" + delFlag + '\'' +
                ", deptId=" + deptId +
                ", projectType='" + projectType + '\'' +
                ", pojectClassification='" + pojectClassification + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", year='" + year + '\'' +
                ", enterpriseName='" + enterpriseName + '\'' +
                '}';
    }

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

}
