feat(数据集):数据集 优化

This commit is contained in:
junjie 2021-05-11 12:27:42 +08:00
parent df09ffd789
commit 9102d56332

View File

@ -557,11 +557,11 @@ public class DataSetTableService {
DatasourceTypes datasourceType = DatasourceTypes.valueOf(type);
switch (datasourceType) {
case mysql:
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY " + fields[0], StringUtils.join(fields, ","), table);
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY " + (fields.length > 0 ? fields[0] : "null"), StringUtils.join(fields, ","), table);
case sqlServer:
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY " + fields[0], StringUtils.join(fields, ","), table);
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY " + (fields.length > 0 ? fields[0] : "null"), StringUtils.join(fields, ","), table);
default:
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY " + fields[0], StringUtils.join(fields, ","), table);
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY " + (fields.length > 0 ? fields[0] : "null"), StringUtils.join(fields, ","), table);
}
}