This commit is contained in:
parent
ffaefb3985
commit
6e3d551a01
|
@ -1,8 +1,12 @@
|
||||||
package io.metersphere.api.dto;
|
package io.metersphere.api.dto;
|
||||||
|
|
||||||
|
import io.metersphere.controller.request.OrderRequest;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class QueryAPITestRequest {
|
public class QueryAPITestRequest {
|
||||||
|
@ -12,5 +16,7 @@ public class QueryAPITestRequest {
|
||||||
private String name;
|
private String name;
|
||||||
private String workspaceId;
|
private String workspaceId;
|
||||||
private boolean recent = false;
|
private boolean recent = false;
|
||||||
|
private List<OrderRequest> orders;
|
||||||
|
private Map<String, List<String>> filters;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,6 @@ public class APITestService {
|
||||||
apiTestMapper.updateByPrimaryKeySelective(test);
|
apiTestMapper.updateByPrimaryKeySelective(test);
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ApiTestWithBLOBs createTest(SaveAPITestRequest request) {
|
private ApiTestWithBLOBs createTest(SaveAPITestRequest request) {
|
||||||
ApiTestExample example = new ApiTestExample();
|
ApiTestExample example = new ApiTestExample();
|
||||||
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId());
|
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId());
|
||||||
|
|
|
@ -26,8 +26,23 @@
|
||||||
<if test="request.id != null">
|
<if test="request.id != null">
|
||||||
AND api_test.id = #{request.id}
|
AND api_test.id = #{request.id}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="reportRequest.filters != null and reportRequest.filters.size() > 0">
|
||||||
|
<foreach collection="reportRequest.filters.entrySet()" index="key" item="values">
|
||||||
|
<if test="values != null and values.size() > 0">
|
||||||
|
and api_test.${key} in
|
||||||
|
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||||
|
#{value}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by api_test.update_time desc
|
<if test="reportRequest.orders != null and reportRequest.orders.size() > 0">
|
||||||
|
order by
|
||||||
|
<foreach collection="reportRequest.orders" separator="," item="order">
|
||||||
|
api_test.${order.name} ${order.type}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="countByProjectId" resultType="java.lang.Long">
|
<select id="countByProjectId" resultType="java.lang.Long">
|
||||||
select count(id) from api_test
|
select count(id) from api_test
|
||||||
|
|
Loading…
Reference in New Issue