liulingling.177216
2024-08-26 349f1cfc5fa77fbc636d542df0d8050fddec48c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
package com.dingzhuo.energy.dataservice.domain;
 
import com.dingzhuo.energy.framework.aspectj.lang.annotation.Excel;
import com.dingzhuo.energy.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.util.StringUtils;
import com.dingzhuo.energy.common.utils.DateUtils;
import java.util.Date;
 
public class StatisticResult extends BaseEntity {
  /**
   * 指标主键
   */
  @Excel(name = "指标主键")
  private String indexId;
  /**
   * 指标编码
   */
  @Excel(name = "指标编码")
  private String indexCode;
  /**
   * 指标名称
   */
  @Excel(name = "指标名称")
  private String indexName;
  /**
   * 单位主键
   */
  @Excel(name = "单位主键")
  private String unitId;
  /**
   * 数据时间
   */
  @Excel(name = "数据时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
  private Date dataTime;
  /**
   * 本期值
   */
  @Excel(name = "本期值")
  private double currentValue;
  /**
   * 上期值
   */
  @Excel(name = "上期值")
  private double previousValue;
  /**
   * 同期值
   */
  @Excel(name = "同期值")
  private double lastYearValue;
  /**
   * 最大值
   */
  @Excel(name = "最大值")
  private double maxValue;
  /**
   * 最小值
   */
  @Excel(name = "最小值")
  private double minValue;
  /**
   * 平均值
   */
  @Excel(name = "平均值")
  private double avgValue;
  //时间
  private String formatdate;
 
  public String getFormatdate() {
    return formatdate;
  }
 
  public void setFormatdate(String formatdate) {
    this.formatdate = DateUtils.parseDateToStr(formatdate,this.dataTime);
  }
  public String getIndexCode() {
    return indexCode;
  }
 
  public void setIndexCode(String indexCode) {
    this.indexCode = indexCode;
  }
 
  public String getIndexName() {
    return indexName;
  }
 
  public void setIndexName(String indexName) {
    this.indexName = indexName;
  }
 
  public String getUnitId() {
    return unitId;
  }
 
  public void setUnitId(String unitId) {
    this.unitId = unitId;
  }
 
  public String getIndexId() {
    return indexId;
  }
 
  public void setIndexId(String indexId) {
    this.indexId = indexId;
  }
 
  public Date getDataTime() {
    return dataTime;
  }
 
  public void setDataTime(Date dataTime) {
    this.dataTime = dataTime;
  }
 
  public double getCurrentValue() {
    return currentValue;
  }
 
  public void setCurrentValue(double currentValue) {
    this.currentValue = currentValue;
  }
 
  public double getPreviousValue() {
    return previousValue;
  }
 
  public void setPreviousValue(double previousValue) {
    this.previousValue = previousValue;
  }
 
  public double getLastYearValue() {
    return lastYearValue;
  }
 
  public void setLastYearValue(double lastYearValue) {
    this.lastYearValue = lastYearValue;
  }
 
  public double getMaxValue() {
    return maxValue;
  }
 
  public void setMaxValue(double maxValue) {
    this.maxValue = maxValue;
  }
 
  /**
   * 同比.
   */
  public double getYoy() {
    if (lastYearValue != 0) {
      return (currentValue - lastYearValue) / lastYearValue * 100;
    }
    return 0;
  }
 
  /**
   * 环比.
   * @return
   */
  public double getQoq() {
    if (previousValue != 0) {
      return (currentValue - previousValue) / previousValue * 100;
    }
    return 0;
  }
 
  public boolean isEmpty() {
    return StringUtils.isEmpty(indexId);
  }
 
  public double getMinValue() {
    return minValue;
  }
 
  public void setMinValue(double minValue) {
    this.minValue = minValue;
  }
 
  public double getAvgValue() {
    return avgValue;
  }
 
  public void setAvgValue(double avgValue) {
    this.avgValue = avgValue;
  }
 
}