forked from github/dataease
fix(数据源列表): 数据源列表按照类型名称和数据源名称升序排序,忽略大小写
This commit is contained in:
parent
d76933d6e8
commit
4ed513c798
@ -125,7 +125,7 @@
|
||||
</if>
|
||||
</where>
|
||||
<if test="sort != null">
|
||||
order by ${sort}
|
||||
order by #{sort}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
@ -158,9 +158,17 @@ public class DatasourceService {
|
||||
}
|
||||
|
||||
public List<DatasourceDTO> getDatasourceList(DatasourceUnionRequest request) throws Exception {
|
||||
request.setSort("type,name");
|
||||
List<DatasourceDTO> datasourceDTOS = extDataSourceMapper.queryUnion(request);
|
||||
datasourceDTOS.forEach(this::datasourceTrans);
|
||||
if (StringUtils.isBlank(request.getSort())) {
|
||||
datasourceDTOS.sort((o1,o2) -> {
|
||||
int tmp = StringUtils.compareIgnoreCase(o1.getTypeDesc(), o2.getTypeDesc());
|
||||
if (tmp == 0) {
|
||||
tmp = StringUtils.compareIgnoreCase(o1.getName(), o2.getName());
|
||||
}
|
||||
return tmp;
|
||||
});
|
||||
}
|
||||
return datasourceDTOS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user