fix: 优化逻辑
This commit is contained in:
parent
93c05da7a8
commit
21a11b3076
@ -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 "";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user