fuliqi
2024-09-23 7a33c5b558e7e4ab5760261accbd32c7f2056c4a
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
package enumeration.general;
 
import lombok.Getter;
 
/**
 * 区域枚举
 * osdName为摄像头上显示的区域名,用于Osd定时任务比对Osd是否正确
 */
@Getter
public enum AreaDeptEnum {
    ZLJQ("自流井区","自流井", "510302", 201),
    GJQ("贡井区", "贡井","510303", 202),
    DAQ("大安区","大安","510304", 102),
    YTQ("沿滩区", "沿滩","510311", 211),
    RX("荣县", "荣县","510321", 203),
    FSX("富顺县", "富顺","510322", 101),
    GXQ("高新区", "高新","510399", 210),
    ;
 
    private final String name;
    private final String osdName;
 
    private final String code;
 
    private final Integer deptId;
 
    AreaDeptEnum(String name,String osdName, String code, Integer deptId) {
        this.name = name;
        this.osdName = osdName;
        this.code = code;
        this.deptId = deptId;
    }
 
    public static AreaDeptEnum fromCode(String code) {
        for (AreaDeptEnum type : AreaDeptEnum.values()) {
            if (type.getCode().equals(code) ) {
                return type;
            }
        }
        return null;
    }
    public static AreaDeptEnum fromDept(Integer deptId) {
        for (AreaDeptEnum type : AreaDeptEnum.values()) {
            if (type.getDeptId().equals(deptId) ) {
                return type;
            }
        }
        return null;
    }
    public static AreaDeptEnum fromName(String name) {
        for (AreaDeptEnum type : AreaDeptEnum.values()) {
            if (type.getName().equals(name) ) {
                return type;
            }
        }
        return null;
    }
 
}