mitao
2024-12-27 9c717849bee3d6cc25f29ad69a93a507e3de7d13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.sinata.system.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum DepartmentEnum {
    REGION(1, "区域"),
    MEDICAL_INSTITUTION(2, "医疗机构"),
    DISPOSAL_UNIT(3, "处置单位"),
    REGULATORY_UNIT(4, "监管单位");
 
    private final Integer code;
    private final String desc;
 
    public static DepartmentEnum getEnumByCode(Integer code) {
        for (DepartmentEnum e : DepartmentEnum.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }