diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java index 79129dca69..48aab649ad 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java @@ -1,10 +1,11 @@ package io.metersphere.base.mapper.ext; +import io.metersphere.controller.request.testplan.QueryTestPlanRequest; import io.metersphere.dto.LoadTestDTO; +import org.apache.ibatis.annotations.Param; import java.util.List; -import java.util.Map; public interface ExtLoadTestMapper { - List list(Map params); + List list(@Param("request") QueryTestPlanRequest params); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml index 9257708443..946015b527 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml @@ -7,10 +7,15 @@ - select load_test.*, project.name as project_name from load_test left join project on load_test.project_id = project.id + + + and load_test.name like CONCAT('%', #{request.name},'%') + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java b/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java index 0adcdca228..263690c957 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java @@ -1,4 +1,15 @@ package io.metersphere.controller.request.testplan; public class QueryTestPlanRequest extends TestPlanRequest { + private String name; + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } } diff --git a/backend/src/main/java/io/metersphere/service/LoadTestService.java b/backend/src/main/java/io/metersphere/service/LoadTestService.java index 99f5a36153..97a8d990ba 100644 --- a/backend/src/main/java/io/metersphere/service/LoadTestService.java +++ b/backend/src/main/java/io/metersphere/service/LoadTestService.java @@ -63,7 +63,7 @@ public class LoadTestService { } public List list(QueryTestPlanRequest request) { - return extLoadTestMapper.list(null); + return extLoadTestMapper.list(request); } public void delete(DeleteTestPlanRequest request) { diff --git a/frontend/src/performance/components/testPlan/AllTestPlan.vue b/frontend/src/performance/components/testPlan/AllTestPlan.vue index f6ce5fa241..65d0e6080f 100644 --- a/frontend/src/performance/components/testPlan/AllTestPlan.vue +++ b/frontend/src/performance/components/testPlan/AllTestPlan.vue @@ -6,8 +6,8 @@ 测试 - + @@ -97,8 +97,9 @@ }, methods: { initTableData() { - /// todo: 查询参数 - let param = {}; + let param = { + name: this.condition + }; this.$post(this.buildPagePath(this.queryPath), param).then(response => { if (response.data.success) { @@ -110,6 +111,9 @@ } }) }, + search() { + this.initTableData(); + }, buildPagePath(path) { return path + "/" + this.currentPage + "/" + this.pageSize; },