recent report
This commit is contained in:
parent
9e5aad7831
commit
61e88258f0
|
@ -19,10 +19,16 @@
|
||||||
select ltr.id, ltr.name, ltr.test_id as testId, ltr.description,
|
select ltr.id, ltr.name, ltr.test_id as testId, ltr.description,
|
||||||
ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, lt.name as testName
|
ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, lt.name as testName
|
||||||
from load_test_report ltr join load_test lt on ltr.test_id = lt.id
|
from load_test_report ltr join load_test lt on ltr.test_id = lt.id
|
||||||
|
<if test="reportRequest.workspaceId != null">
|
||||||
|
JOIN project on project.id = lt.project_id
|
||||||
|
</if>
|
||||||
<where>
|
<where>
|
||||||
<if test="reportRequest.name != null">
|
<if test="reportRequest.name != null">
|
||||||
AND ltr.name like CONCAT('%', #{reportRequest.name},'%')
|
AND ltr.name like CONCAT('%', #{reportRequest.name},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="reportRequest.workspaceId != null">
|
||||||
|
AND workspace_id = #{reportRequest.workspaceId,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY ltr.update_time DESC
|
ORDER BY ltr.update_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class PerformanceReportController {
|
||||||
|
|
||||||
@GetMapping("/recent/{count}")
|
@GetMapping("/recent/{count}")
|
||||||
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
|
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
|
||||||
public List<LoadTestReport> recentProjects(@PathVariable int count) {
|
public List<ReportDTO> recentProjects(@PathVariable int count) {
|
||||||
String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId();
|
String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId();
|
||||||
ReportRequest request = new ReportRequest();
|
ReportRequest request = new ReportRequest();
|
||||||
request.setWorkspaceId(currentWorkspaceId);
|
request.setWorkspaceId(currentWorkspaceId);
|
||||||
|
@ -38,6 +38,8 @@ public class PerformanceReportController {
|
||||||
|
|
||||||
@PostMapping("/list/all/{goPage}/{pageSize}")
|
@PostMapping("/list/all/{goPage}/{pageSize}")
|
||||||
public Pager<List<ReportDTO>> getReportList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ReportRequest request) {
|
public Pager<List<ReportDTO>> getReportList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ReportRequest request) {
|
||||||
|
String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId();
|
||||||
|
request.setWorkspaceId(currentWorkspaceId);
|
||||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
return PageUtils.setPageInfo(page, reportService.getReportList(request));
|
return PageUtils.setPageInfo(page, reportService.getReportList(request));
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,13 +35,8 @@ public class ReportService {
|
||||||
@Resource
|
@Resource
|
||||||
private LoadTestReportResultMapper loadTestReportResultMapper;
|
private LoadTestReportResultMapper loadTestReportResultMapper;
|
||||||
|
|
||||||
public List<LoadTestReport> getRecentReportList(ReportRequest request) {
|
public List<ReportDTO> getRecentReportList(ReportRequest request) {
|
||||||
LoadTestReportExample example = new LoadTestReportExample();
|
return extLoadTestReportMapper.getReportList(request);
|
||||||
LoadTestReportExample.Criteria criteria = example.createCriteria();
|
|
||||||
//
|
|
||||||
|
|
||||||
example.setOrderByClause("update_time desc");
|
|
||||||
return loadTestReportMapper.selectByExample(example);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ReportDTO> getReportList(ReportRequest request) {
|
public List<ReportDTO> getReportList(ReportRequest request) {
|
||||||
|
|
Loading…
Reference in New Issue