Merge pull request #7315 from dataease/pr@dev@fix_pg_number_like_filter
fix: PG数据源使用数字下拉模糊搜索报错
This commit is contained in:
commit
5d59334b67
@ -183,8 +183,13 @@ public class PgQueryProvider extends QueryProvider {
|
|||||||
String whereTrees = transFilterTrees(tableObj, rowPermissionsTree);
|
String whereTrees = transFilterTrees(tableObj, rowPermissionsTree);
|
||||||
List<String> wheres = new ArrayList<>();
|
List<String> wheres = new ArrayList<>();
|
||||||
if (customWheres != null) wheres.add(customWheres);
|
if (customWheres != null) wheres.add(customWheres);
|
||||||
if (StringUtils.isNotBlank(keyword)) {
|
if (StringUtils.isNotBlank(keyword) && CollectionUtils.isNotEmpty(xFields)) {
|
||||||
String keyWhere = "(" + transKeywordFilterList(tableObj, xFields, keyword) + ")";
|
List<SQLObj> formatFields = xFields.stream().peek(f -> {
|
||||||
|
String fieldOriginName = f.getFieldOriginName();
|
||||||
|
String format = String.format(PgConstants.CAST, fieldOriginName, "VARCHAR");
|
||||||
|
f.setFieldOriginName(format);
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
String keyWhere = "(" + transKeywordFilterList(tableObj, formatFields, keyword) + ")";
|
||||||
wheres.add(keyWhere);
|
wheres.add(keyWhere);
|
||||||
}
|
}
|
||||||
if (whereTrees != null) wheres.add(whereTrees);
|
if (whereTrees != null) wheres.add(whereTrees);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user