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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
| package com.javaweb.geo.enums;
|
| public enum RecordType {
|
| /**
| * 出入库状态
| */
| deviceLog_in("in","入库"),
| deviceLog_out("out","出库"),
|
| /**
| * 出入库状态
| */
| projectStatus0("0","未协调"),
| projectStatus1("1","已协调"),
| projectStatus2("2","施工中"),
|
| /**
| * 记录分类(必填,直接填写汉字,因考虑历史数据原因,
| * “机长”表示司钻员)
| * 回次、岩土、取土、标贯、动探、水位、取水、负责人、工程师、机长、钻机
| */
| hc("回次","回次"),
| yt("岩土","岩土"),
| qt("取土","取土"),
| bg("标贯","标贯"),
| dt("动探","动探"),
| sw("水位","水位"),
| qs("取水","取水"),
| fzr("负责人","负责人"),
| gcs("工程师","工程师"),
| jz("机长","机长"),
| zj("钻机","钻机"),
|
|
| /**
| * 是否删除
| */
| isDelete0("0","未删除"),
| isDelete1("1","已删除"),
|
| /**
| * 勘探点状态 1-验收通过,2-验收不通过,3-废孔
| */
| holeStatus1("1","验收通过"),
| holeStatus2("2","验收不通过"),
| holeStatus3("3","废孔");
|
|
| private String id ;
| private String name ;
|
| RecordType(String id, String name) {
| this.id = id;
| this.name = name;
| }
|
| public String getId() {
| return id;
| }
|
| public void setId(String id) {
| this.id = id;
| }
|
| public String getName() {
| return name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| /**
| * 根据id获取name
| */
| public static String getValueByKey(String id) {
| RecordType[] recordTypes = values();
| for (RecordType item: recordTypes) {
| if (item.getId().equals(id)) {
| return item.getName();
| }
| }
| return null;
| }
|
| /**
| * 根据name获取id
| */
| public static String getKeyByName(String name) {
| RecordType[] recordTypes = values();
| for (RecordType item: recordTypes) {
| if (item.getName().equals(name)) {
| return item.getId();
| }
| }
| return null;
| }
|
| public static void main(String[] args) {
| String valueByKey = RecordType.getKeyByName("水文-水文测井");
| System.out.println(valueByKey);
|
| }
|
| }
|
|