parent
a4eab7b39c
commit
6680cd4ded
|
@ -36,6 +36,7 @@ public class APIScenarioReportController {
|
||||||
@PostMapping("/list/{goPage}/{pageSize}")
|
@PostMapping("/list/{goPage}/{pageSize}")
|
||||||
public Pager<List<APIScenarioReportResult>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryAPIReportRequest request) {
|
public Pager<List<APIScenarioReportResult>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryAPIReportRequest request) {
|
||||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
|
request.setLimit("LIMIT " + (goPage - 1) * pageSize + "," + pageSize * 50);
|
||||||
return PageUtils.setPageInfo(page, apiReportService.list(request));
|
return PageUtils.setPageInfo(page, apiReportService.list(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,4 +20,6 @@ public class QueryAPIReportRequest {
|
||||||
private List<OrderRequest> orders;
|
private List<OrderRequest> orders;
|
||||||
private Map<String, List<String>> filters;
|
private Map<String, List<String>> filters;
|
||||||
private Map<String, Object> combine;
|
private Map<String, Object> combine;
|
||||||
|
|
||||||
|
private String limit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,7 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="list" resultMap="BaseResultMap">
|
<select id="list" resultMap="BaseResultMap">
|
||||||
|
select * from (
|
||||||
select * from (
|
select * from (
|
||||||
SELECT s_r.name AS test_name,
|
SELECT s_r.name AS test_name,
|
||||||
s_r.end_time,
|
s_r.end_time,
|
||||||
|
@ -196,8 +197,19 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
AND s_r.execute_type = 'Saved'
|
AND s_r.execute_type = 'Saved'
|
||||||
|
<if test="request.orders != null and request.orders.size() > 0">
|
||||||
|
order by
|
||||||
|
<foreach collection="request.orders" separator="," item="order">
|
||||||
|
${order.name} ${order.type}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="request.limit != null">
|
||||||
|
${request.limit}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
) apiScenarioReport
|
||||||
union
|
union
|
||||||
|
select * from (
|
||||||
select a_r.name as test_name,
|
select a_r.name as test_name,
|
||||||
a_r.end_time,
|
a_r.end_time,
|
||||||
a_r.user_id,
|
a_r.user_id,
|
||||||
|
@ -254,6 +266,16 @@
|
||||||
</if>
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="request.orders != null and request.orders.size() > 0">
|
||||||
|
order by
|
||||||
|
<foreach collection="request.orders" separator="," item="order">
|
||||||
|
${order.name} ${order.type}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="request.limit != null">
|
||||||
|
${request.limit}
|
||||||
|
</if>
|
||||||
|
) apiDefinitionReport
|
||||||
) r
|
) r
|
||||||
<if test="request.orders != null and request.orders.size() > 0">
|
<if test="request.orders != null and request.orders.size() > 0">
|
||||||
order by
|
order by
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE `api_definition_exec_result` ADD INDEX projectIdIndex ( `project_id` );
|
||||||
|
ALTER TABLE `api_scenario_report` ADD INDEX projectIdIndex ( `project_id` );
|
||||||
|
ALTER TABLE `api_scenario_report` ADD INDEX projectIdexectypeIndex ( `project_id`,`execute_type` );
|
Loading…
Reference in New Issue