package com.panzhihua.common.enums; import lombok.Getter; /** * 房屋管控状态 * * @author LYQ */ @Getter public enum PopulHouseControlStatusEnum { CG(1, "常规"), GZ(2, "关注"), GK(3, "管控"); private final Integer code; private final String name; PopulHouseControlStatusEnum(Integer code, String name) { this.code = code; this.name = name; } public static int getCodeByName(String name) { for (PopulHouseControlStatusEnum item : PopulHouseControlStatusEnum.values()) { if (item.name.equals(name)) { return item.getCode(); } } return -1; } public static String getCnDescByName(Integer code) { for (PopulHouseControlStatusEnum item : PopulHouseControlStatusEnum.values()) { if (item.code.equals(code)) { return item.getName(); } } return ""; } }