Merge pull request #13453 from dataease/pr@dev-v2@fix_ds

fix(数据集): 修复数值下拉多选出错 #13449
This commit is contained in:
dataeaseShu 2024-11-21 10:05:21 +08:00 committed by GitHub
commit 6119a9cf6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -606,7 +606,11 @@ public class SqlparserUtils {
&& sqlVariableDetails.getDeType() == 0) {
return "N'" + String.join("', N'", sqlVariableDetails.getValue()) + "'";
} else {
return "'" + String.join("','", sqlVariableDetails.getValue()) + "'";
if (sqlVariableDetails.getDeType() == 2 || sqlVariableDetails.getDeType() == 3) {
return String.join(",", sqlVariableDetails.getValue());
} else {
return "'" + String.join("','", sqlVariableDetails.getValue()) + "'";
}
}
} else if (sqlVariableDetails.getOperator().equals("between")) {
if (sqlVariableDetails.getDeType() == 1) {

View File

@ -168,7 +168,11 @@ public class ExtWhere2Str {
|| StringUtils.containsIgnoreCase(request.getDatasetTableField().getType(), "NCHAR")) {
whereValue = "(" + value.stream().map(str -> "'" + SQLConstants.MSSQL_N_PREFIX + str + "'").collect(Collectors.joining(",")) + ")";
} else {
whereValue = "('" + StringUtils.join(value, "','") + "')";
if (request.getDatasetTableField().getDeType() == 2 || request.getDatasetTableField().getDeType() == 3) {
whereValue = "(" + StringUtils.join(value, ",") + ")";
} else {
whereValue = "('" + StringUtils.join(value, "','") + "')";
}
}
}
}