fix(接口测试): 接口测试导出排序方式处理

This commit is contained in:
Jianguo-Genius 2024-09-14 17:19:45 +08:00 committed by 建国
parent a885cbefd5
commit bc0863dd18
2 changed files with 3 additions and 2 deletions

View File

@ -107,7 +107,7 @@
</if> </if>
<include refid="queryWhereConditionByBaseQueryRequest"/> <include refid="queryWhereConditionByBaseQueryRequest"/>
<if test="orderColumns != null"> <if test="orderColumns != null">
ORDER BY #{orderColumns} ORDER BY ${orderColumns}
</if> </if>
</select> </select>

View File

@ -209,7 +209,8 @@ public class ApiDefinitionExportService {
} }
if (request.isSelectAll()) { if (request.isSelectAll()) {
List<String> ids = extApiDefinitionMapper.getIdsBySort(request, request.getProjectId(), protocols, request.getSortString()); String sortString = StringUtils.isBlank(request.getSortString()) ? "pos desc,id desc" : request.getSortString();
List<String> ids = extApiDefinitionMapper.getIdsBySort(request, request.getProjectId(), protocols, sortString);
if (CollectionUtils.isNotEmpty(request.getExcludeIds())) { if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {
ids.removeAll(request.getExcludeIds()); ids.removeAll(request.getExcludeIds());
} }