fix: 优化逻辑

This commit is contained in:
tangwei 2026-06-02 16:34:34 +08:00
parent 93c05da7a8
commit 21a11b3076

View File

@ -1455,6 +1455,24 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
case "contains": case "contains":
paramMap.put(key, "%" + filter.getValue() + "%"); paramMap.put(key, "%" + filter.getValue() + "%");
return column + " LIKE #{map." + key + "}"; return column + " LIKE #{map." + key + "}";
case "in": {
List<?> list = null;
if (filter.getValue() instanceof List<?> l) {
list = l;
} else if (filter.getValue() instanceof Object[] arr) {
list = Arrays.asList(arr);
}
if (list != null && !list.isEmpty()) {
List<String> placeholders = new ArrayList<>();
for (Object item : list) {
String itemKey = "envWqParam" + indexHolder[0]++;
paramMap.put(itemKey, item);
placeholders.add("#{map." + itemKey + "}");
}
return column + " IN (" + String.join(", ", placeholders) + ")";
}
return "";
}
default: default:
return ""; return "";
} }