diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java index 8deaf22730..a6e244dce2 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java @@ -98,7 +98,11 @@ public class TestPlanReportShareController { ShareInfo shareInfo = testPlanReportShareService.checkResource(request.getShareId()); testPlanReportShareService.validateExpired(shareInfo); Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprb.bug_num, tprb.id desc"); + StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprb.bug_num desc"); + if (!request.getStartPager()) { + page.close(); + page.setOrderBy("tprb.bug_num desc"); + } return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailBugs(request)); } @@ -112,6 +116,13 @@ public class TestPlanReportShareController { sort = StringUtils.replace(sort, "request_time", "request_duration"); Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(sort) ? sort : "tprfc.pos desc"); + if (!request.getStartPager()) { + // 不分页仅排序 {测试集升序, 用例位次倒序} + page.setPageSize(0); + page.setPageSizeZero(true); + page.setOrderBy("tpc.pos, tpc.name, tprfc.pos desc"); + page.setOrderByOnly(true); + } return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailCases(request, null, AssociateCaseType.FUNCTIONAL)); } @@ -125,6 +136,13 @@ public class TestPlanReportShareController { sort = StringUtils.replace(sort, "request_time", "request_duration"); Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(sort) ? sort : "tprac.pos desc"); + if (!request.getStartPager()) { + // 不分页仅排序 {测试集升序, 用例位次倒序} + page.setPageSize(0); + page.setPageSizeZero(true); + page.setOrderBy("tpc.pos, tpc.name, tprac.pos desc"); + page.setOrderByOnly(true); + } return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailCases(request, null, AssociateCaseType.API_CASE)); } @@ -138,6 +156,13 @@ public class TestPlanReportShareController { sort = StringUtils.replace(sort, "request_time", "request_duration"); Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(sort) ? sort : "tpras.pos desc"); + if (!request.getStartPager()) { + // 不分页仅排序 {测试集升序, 用例位次倒序} + page.setPageSize(0); + page.setPageSizeZero(true); + page.setOrderBy("tpc.pos, tpc.name, tpras.pos desc"); + page.setOrderByOnly(true); + } return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailCases(request, null, AssociateCaseType.API_SCENARIO)); } @@ -148,6 +173,9 @@ public class TestPlanReportShareController { testPlanReportShareService.validateExpired(shareInfo); Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tpr.create_time desc"); + if (!request.getStartPager()) { + page.close(); + } return PageUtils.setPageInfo(page, testPlanReportService.planReportList(request)); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml index ed1a5175cd..bd9cdf7955 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml @@ -113,7 +113,7 @@ - + and t.type = 'TEST_PLAN' and t.create_user = #{request.myTodoUserId}