import org.apache.commons.lang3.StringUtils;
/**
*
*
*/
public enum HyEnumHopt {
HP_SZY_GG("344","454515","静安院区","SH_JA"),
HP_ZX_NJL("105201","856502705414","普陀院区","SH_PT"),
private String HoptCode;
private String HyHoptCode;
private String HoptName;
private String Origin;
public String getHoptCode() {
return HoptCode;
}
public void setHoptCode(String hoptCode) {
HoptCode = hoptCode;
}
public String getHyHoptCode() {
return HyHoptCode;
}
public void setHyHoptCode(String hyHoptCode) {
HyHoptCode = hyHoptCode;
}
public String getHoptName() {
return HoptName;
}
public void setHoptName(String hoptName) {
HoptName = hoptName;
}
public String getOrigin() {
return Origin;
}
public void setOrigin(String origin) {
Origin = origin;
}
private HyEnumHopt(String hoptCode, String hyHoptCode, String hoptName,
String origin) {
HoptCode = hoptCode;
HyHoptCode = hyHoptCode;
HoptName = hoptName;
Origin = origin;
}
public static void main(String[] args) {
String nn = HyEnumHopt.getByHyCode("45145").getHoptCode();
System.out.println(nn);
HyEnumHopt jj = HyEnumHopt.HP_TJ.getByHyCode("5454");
System.out.println(jj);
String mm = HyEnumHopt.HP_TJ.getHoptCode();
System.out.println(mm);
}
//根据好医网医院编号真实编号获取枚举
public static HyEnumHopt getByHyCode(String hyHoptCode) {
if (StringUtils.isBlank(hyHoptCode)) {
return null;
}
for (HyEnumHopt trans : values()) {
if (StringUtils.equals(trans.getHyHoptCode(), hyHoptCode)) {
return trans;
}
}
return null;
}
//根据医院真实编号获取枚举
public static HyEnumHopt getByHoptCode(String hoptCode) {
if (StringUtils.isBlank(hoptCode)) {
return null;
}
for (HyEnumHopt trans : values()) {
if (StringUtils.equals(trans.getHoptCode(), hoptCode)) {
return trans;
}
}
return null;
}
}