fix: 树形过滤失败

This commit is contained in:
taojinlong 2023-09-07 17:09:40 +08:00
parent 055121ce8f
commit 752561e74c

View File

@ -1149,7 +1149,7 @@ public class SqlserverQueryProvider extends QueryProvider {
String whereValue = "";
if (StringUtils.containsIgnoreCase(request.getOperator(), "in")) {
if(request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) {
if(request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) {
whereValue = "(" + value.stream().map(str -> {
return "N" + "'" + str + "'";
}).collect(Collectors.joining(",")) + ")";
@ -1171,7 +1171,7 @@ public class SqlserverQueryProvider extends QueryProvider {
}
} else {
if(request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")){
if(request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")){
whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE_CH, value.get(0));
}else {
whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE, value.get(0));