diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml index 1774a420..6201b68d 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml @@ -5,7 +5,8 @@ + + + \ No newline at end of file diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java index c35d38a6..a8fa2b51 100644 --- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java @@ -117,10 +117,7 @@ public class DictAspect { private String queryDictLabel(String dictTable, String dictCode, String dictText, String dictValue) { if (StringUtils.hasText(dictTable)) { - // 场景 1:默认字典走DictUtils缓存 - return DictUtils.getDictLabel(dictCode, dictValue); - } else { - // 场景 2:查询指定表 + // 场景 1:查询指定表 String sql = String.format("SELECT %s FROM %s WHERE %s::varchar = ? LIMIT 1", dictText, dictTable, dictCode); try { return jdbcTemplate.queryForObject(sql, String.class, dictValue); @@ -128,6 +125,9 @@ public class DictAspect { // 如果查询结果为空,返回 空字符串 return ""; } + } else { + // 场景 2:默认字典走DictUtils缓存 + return DictUtils.getDictLabel(dictCode, dictValue); } } } \ No newline at end of file