fix: 修复SQL Server低版本不支持CONCAT函数的问题

This commit is contained in:
junjun
2025-12-05 12:21:48 +08:00
committed by Junjun
parent 5429c2b897
commit 0cbc7e285f

View File

@@ -141,7 +141,11 @@ public class ExtWhere2Str {
if (StringUtils.equalsIgnoreCase(dsType, DatasourceConfiguration.DatasourceType.sqlServer.getType()) && whereNameList.size() == 1) {
whereName = whereNameList.get(0);
} else {
whereName = "CONCAT(" + StringUtils.join(whereNameList, ",',',") + ")";
if (StringUtils.equalsIgnoreCase(dsType, DatasourceConfiguration.DatasourceType.sqlServer.getType())) {
whereName = "(" + StringUtils.join(whereNameList, "+','+") + ")";
} else {
whereName = "CONCAT(" + StringUtils.join(whereNameList, ",',',") + ")";
}
}
} else {
whereName = whereNameList.get(0);