feat_测试计划报告新增高级搜索
This commit is contained in:
parent
fd5108666c
commit
bab9cc98a1
|
@ -2,15 +2,106 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="io.metersphere.base.mapper.ext.ExtTestPlanReportMapper">
|
<mapper namespace="io.metersphere.base.mapper.ext.ExtTestPlanReportMapper">
|
||||||
|
|
||||||
|
<sql id="condition">
|
||||||
|
<choose>
|
||||||
|
<when test='${object}.operator == "like"'>
|
||||||
|
like CONCAT('%', #{${object}.value},'%')
|
||||||
|
</when>
|
||||||
|
<when test='${object}.operator == "not like"'>
|
||||||
|
not like CONCAT('%', #{${object}.value},'%')
|
||||||
|
</when>
|
||||||
|
<when test='${object}.operator == "in"'>
|
||||||
|
in
|
||||||
|
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
|
||||||
|
#{v}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
<when test='${object}.operator == "not in"'>
|
||||||
|
not in
|
||||||
|
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
|
||||||
|
#{v}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
<when test='${object}.operator == "between"'>
|
||||||
|
between #{${object}.value[0]} and #{${object}.value[1]}
|
||||||
|
</when>
|
||||||
|
<when test='${object}.operator == "gt"'>
|
||||||
|
> #{${object}.value}
|
||||||
|
</when>
|
||||||
|
<when test='${object}.operator == "lt"'>
|
||||||
|
< #{${object}.value}
|
||||||
|
</when>
|
||||||
|
<when test='${object}.operator == "ge"'>
|
||||||
|
>= #{${object}.value}
|
||||||
|
</when>
|
||||||
|
<when test='${object}.operator == "le"'>
|
||||||
|
<= #{${object}.value}
|
||||||
|
</when>
|
||||||
|
<when test='${object}.operator == "current user"'>
|
||||||
|
= '${@io.metersphere.commons.utils.SessionUtils@getUserId()}'
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
= #{${object}.value}
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="combine">
|
||||||
|
<if test='${condition}.name != null and (${name} == null or ${name} == "")'>
|
||||||
|
and tpr.name
|
||||||
|
<include refid="condition">
|
||||||
|
<property name="object" value="${condition}.name"/>
|
||||||
|
</include>
|
||||||
|
</if>
|
||||||
|
<if test="${condition}.creator != null">
|
||||||
|
and tpr.creator
|
||||||
|
<include refid="condition">
|
||||||
|
<property name="object" value="${condition}.creator"/>
|
||||||
|
</include>
|
||||||
|
|
||||||
|
</if>
|
||||||
|
<if test="${condition}.testPlanName != null">
|
||||||
|
and tp.name
|
||||||
|
<include refid="condition">
|
||||||
|
<property name="object" value="${condition}.testPlanName"/>
|
||||||
|
</include>
|
||||||
|
|
||||||
|
</if>
|
||||||
|
<if test="${condition}.createTime != null">
|
||||||
|
and tpr.create_time
|
||||||
|
<include refid="condition">
|
||||||
|
<property name="object" value="${condition}.createTime"/>
|
||||||
|
</include>
|
||||||
|
</if>
|
||||||
|
<if test="${condition}.status != null">
|
||||||
|
and tpr.status
|
||||||
|
<include refid="condition">
|
||||||
|
<property name="object" value="${condition}.status"/>
|
||||||
|
</include>
|
||||||
|
</if>
|
||||||
|
<if test="${condition}.triggerMode != null">
|
||||||
|
and tpr.trigger_mode
|
||||||
|
<include refid="condition">
|
||||||
|
<property name="object" value="${condition}.triggerMode"/>
|
||||||
|
</include>
|
||||||
|
</if>
|
||||||
|
</sql>
|
||||||
|
|
||||||
<select id="list" resultType="io.metersphere.track.dto.TestPlanReportDTO"
|
<select id="list" resultType="io.metersphere.track.dto.TestPlanReportDTO"
|
||||||
parameterType="io.metersphere.track.request.report.QueryTestPlanReportRequest">
|
parameterType="io.metersphere.track.request.report.QueryTestPlanReportRequest">
|
||||||
SELECT tpr.id AS id, tpr.`name` AS `name`, tp.`name` AS testPlanName,
|
SELECT tpr.id AS id, tpr.`name` AS `name`, tp.`name` AS testPlanName,
|
||||||
IF(u.name is null,tpr.creator,u.name)AS creator, tpr.is_new, tpr.test_plan_id,
|
IF(u.name is null,tpr.creator,u.name)AS creator, tpr.is_new, tpr.test_plan_id,
|
||||||
tpr.create_time AS createTime,tpr.trigger_Mode AS triggerMode,tpr.status AS status
|
tpr.create_time AS createTime,tpr.trigger_mode AS triggerMode,tpr.status AS status
|
||||||
FROM test_plan tp
|
FROM test_plan tp
|
||||||
INNER JOIN test_plan_report tpr on tp.id = tpr.test_plan_id
|
INNER JOIN test_plan_report tpr on tp.id = tpr.test_plan_id
|
||||||
LEFT JOIN user u on tpr.creator = u.id
|
LEFT JOIN user u on tpr.creator = u.id
|
||||||
<where>
|
<where>
|
||||||
|
<if test="combine != null">
|
||||||
|
<include refid="combine">
|
||||||
|
<property name="condition" value="combine"/>
|
||||||
|
<property name="name" value="name"/>
|
||||||
|
</include>
|
||||||
|
</if>
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
and tpr.name like CONCAT('%', #{name},'%')
|
and tpr.name like CONCAT('%', #{name},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -15,7 +15,7 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Data
|
|
||||||
public class QueryTestPlanReportRequest {
|
public class QueryTestPlanReportRequest {
|
||||||
private String name;
|
private String name;
|
||||||
private String testPlanName;
|
private String testPlanName;
|
||||||
|
@ -23,6 +23,8 @@ public class QueryTestPlanReportRequest {
|
||||||
private String workspaceId;
|
private String workspaceId;
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
|
private Map<String, Object> combine;
|
||||||
|
|
||||||
private List<OrderRequest> orders;
|
private List<OrderRequest> orders;
|
||||||
private Map<String, List<String>> filters;
|
private Map<String, List<String>> filters;
|
||||||
|
|
||||||
|
|
|
@ -575,7 +575,6 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else{
|
} else{
|
||||||
this.$store.state.apiMap.delete(tabs[1].api.id);
|
|
||||||
this.handleTabRemove(targetName);
|
this.handleTabRemove(targetName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -457,6 +457,7 @@ export const TEST_PLAN_TRIGGER_MODE = {
|
||||||
options: [
|
options: [
|
||||||
{label: 'test_track.report.trigger_mode.manual', value: 'manual'},
|
{label: 'test_track.report.trigger_mode.manual', value: 'manual'},
|
||||||
{label: 'test_track.report.trigger_mode.automation', value: 'automation'},
|
{label: 'test_track.report.trigger_mode.automation', value: 'automation'},
|
||||||
|
{label: "commons.trigger_mode.schedule", value: "SCHEDULE"},
|
||||||
],
|
],
|
||||||
props: {
|
props: {
|
||||||
multiple: true
|
multiple: true
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
import TestPlanReportList from './components/TestPlanReportList';
|
import TestPlanReportList from './components/TestPlanReportList';
|
||||||
import MsContainer from "../../common/components/MsContainer";
|
import MsContainer from "../../common/components/MsContainer";
|
||||||
import MsMainContainer from "../../common/components/MsMainContainer";
|
import MsMainContainer from "../../common/components/MsMainContainer";
|
||||||
|
import {TEST_PLAN_REPORT_CONFIGS} from "@/business/components/common/components/search/search-components";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanReport",
|
name: "TestPlanReport",
|
||||||
|
@ -32,7 +33,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
refreshTestPlanList() {
|
refreshTestPlanList() {
|
||||||
this.$refs.testPlanReportList.condition = {};
|
this.$refs.testPlanReportList.condition = {components: TEST_PLAN_REPORT_CONFIGS};
|
||||||
this.$refs.testPlanReportList.initTableData();
|
this.$refs.testPlanReportList.initTableData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
this.components = TEST_PLAN_REPORT_CONFIGS;
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.projectId = this.$route.params.projectId;
|
this.projectId = this.$route.params.projectId;
|
||||||
|
|
Loading…
Reference in New Issue