package com.panzhihua.common.enums;
|
|
import lombok.Getter;
|
|
/**
|
*
|
*
|
* @author manaiilin
|
*/
|
@Getter
|
public enum KeyPersonLabelEnum {
|
XD(1, "吸毒人员"), ZJ(2, "重精人员"), XJ(3, "邪教人员"), QT(4, "其他重点人员");
|
|
private final Integer code;
|
private final String name;
|
|
KeyPersonLabelEnum(Integer code, String name) {
|
this.code = code;
|
this.name = name;
|
}
|
|
public static int getCodeByName(String name) {
|
for (KeyPersonLabelEnum item : KeyPersonLabelEnum.values()) {
|
if (item.name.equals(name)) {
|
return item.getCode();
|
}
|
}
|
return -1;
|
}
|
|
public static String getCnDescByName(Integer code) {
|
for (KeyPersonLabelEnum item : KeyPersonLabelEnum.values()) {
|
if (item.code.equals(code)) {
|
return item.getName();
|
}
|
}
|
return "其他";
|
}
|
|
}
|