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;
|
}
|
|
}
|