mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
fix(图表): 修复下拉树过滤出错的问题
This commit is contained in:
parent
0f3ad8af4d
commit
465f3c2924
@ -190,6 +190,23 @@ public class ExtWhere2Str {
|
||||
// 过滤空数据
|
||||
if (StringUtils.equals(value.get(0), SQLConstants.EMPTY_SIGN)) {
|
||||
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, "") + " or " + whereName + " is null ";
|
||||
} else {
|
||||
// tree的情况需额外处理
|
||||
if (request.getIsTree()) {
|
||||
List<DatasetTableFieldDTO> datasetTableFieldList = request.getDatasetTableFieldList();
|
||||
boolean hasN = false;
|
||||
for (DatasetTableFieldDTO dto : datasetTableFieldList) {
|
||||
if (StringUtils.containsIgnoreCase(dto.getType(), "NVARCHAR")
|
||||
|| StringUtils.containsIgnoreCase(dto.getType(), "NCHAR")) {
|
||||
hasN = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasN) {
|
||||
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE_CH, value.get(0));
|
||||
} else {
|
||||
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.containsIgnoreCase(request.getDatasetTableField().getType(), "NVARCHAR")
|
||||
|| StringUtils.containsIgnoreCase(request.getDatasetTableField().getType(), "NCHAR")) {
|
||||
@ -199,6 +216,7 @@ public class ExtWhere2Str {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
list.add(SQLObj.builder()
|
||||
.whereField(whereName)
|
||||
.whereTermAndValue(whereTerm + whereValue)
|
||||
|
Loading…
Reference in New Issue
Block a user