提交 | 用户 | 时间
|
cf757d
|
1 |
package com.iailab.module.data.common.enums; |
潘 |
2 |
|
|
3 |
import lombok.AllArgsConstructor; |
|
4 |
import lombok.Getter; |
|
5 |
|
|
6 |
/** |
|
7 |
* @author PanZhibao |
|
8 |
* @Description |
|
9 |
* @createTime 2024年05月25日 |
|
10 |
*/ |
|
11 |
@Getter |
|
12 |
@AllArgsConstructor |
|
13 |
public enum IndTimeLimitEnum { |
|
14 |
|
|
15 |
TODAY("TODAY", "今天"), |
|
16 |
YESTERDAY("YESTERDAY", "昨天"), |
|
17 |
LAST_DAY_7("LAST_DAY_7", "最近7天"), |
|
18 |
LAST_DAY_30("LAST_DAY_30", "最近30天"), |
|
19 |
THIS_MONTH("THIS_MONTH", "当前月"), |
|
20 |
LAST_MONTH_12("LAST_MONTH_12", "最近12个月"), |
|
21 |
THIS_YEAR_MONTH("THIS_YEAR_MONTH", "当年月份"), |
|
22 |
LAST_YEAR("LAST_YEAR", "去年"), |
|
23 |
THIS_YEAR("THIS_YEAR_MONTH", "今年"), |
|
24 |
CUSTOM("CUSTOM", "自定义"); |
|
25 |
|
|
26 |
private String code; |
|
27 |
private String desc; |
|
28 |
|
|
29 |
public static IndTimeLimitEnum getEumByCode(String code) { |
|
30 |
if (code == null) { |
|
31 |
return null; |
|
32 |
} |
|
33 |
|
|
34 |
for (IndTimeLimitEnum statusEnum : IndTimeLimitEnum.values()) { |
|
35 |
if (statusEnum.getCode().equals(code)) { |
|
36 |
return statusEnum; |
|
37 |
} |
|
38 |
} |
|
39 |
return null; |
|
40 |
} |
|
41 |
} |