admin
2022-03-25 17055fd8d36504b79a5def28f5d4b4740faf012d
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
package org.yeshi.utils.statistic;
 
/**
 * @author hxh
 * @title: StatisticSpan
 * @description: 统计的时间粒度
 * @date 2021/11/18 18:21
 */
public enum StatisticTimeSpan {
    minute("%Y-%m-%d %H %i", "yyyy-MM-dd HH mm"), hour("%Y-%m-%d %H", "yyyy-MM-dd HH"), day("%Y-%m-%d", "yyyy-MM-dd"), month("%Y-%m", "yyyy-MM"), year("%Y", "yyyy");
    private String sqlTimeFormat;
    private String localTimeFormat;
 
    private StatisticTimeSpan(String sqlTimeFormat, String localTimeFormat) {
        this.sqlTimeFormat = sqlTimeFormat;
        this.localTimeFormat = localTimeFormat;
    }
 
    public String getSqlTimeFormat() {
        return sqlTimeFormat;
    }
 
    public String getLocalTimeFormat() {
        return localTimeFormat;
    }
}