诊疗下面没有诊疗项目

This commit is contained in:
2026-01-22 14:03:38 +08:00
parent 1dd7ee3428
commit 49550fcc2e
19 changed files with 1268 additions and 25 deletions

View File

@@ -117,10 +117,15 @@ public class DictAspect {
private String queryDictLabel(String dictTable, String dictCode, String dictText, String dictValue) {
if (!StringUtils.hasText(dictTable)) {
// 场景 1默认字典走DictUtils缓存
// 场景 1默认字典走DictUtils缓存dictTable 为空时)
return DictUtils.getDictLabel(dictCode, dictValue);
} else {
// 场景 2查询指定表
// 场景 2查询指定表dictTable 有值时)
// 必须同时有 dictTable 和 dictText 才能执行 SQL 查询
if (!StringUtils.hasText(dictText)) {
// 如果 dictText 为空,回退到字典缓存查询
return DictUtils.getDictLabel(dictCode, dictValue);
}
String sql = String.format("SELECT %s FROM %s WHERE %s::varchar = ? LIMIT 1", dictText, dictTable, dictCode);
try {
return jdbcTemplate.queryForObject(sql, String.class, dictValue);