recent report

This commit is contained in:
Captain.B 2020-04-24 10:19:23 +08:00
parent 9e5aad7831
commit 61e88258f0
3 changed files with 11 additions and 8 deletions

View File

@ -19,10 +19,16 @@
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
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>
<if test="reportRequest.name != null">
AND ltr.name like CONCAT('%', #{reportRequest.name},'%')
</if>
<if test="reportRequest.workspaceId != null">
AND workspace_id = #{reportRequest.workspaceId,jdbcType=VARCHAR}
</if>
</where>
ORDER BY ltr.update_time DESC
</select>

View File

@ -27,7 +27,7 @@ public class PerformanceReportController {
@GetMapping("/recent/{count}")
@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();
ReportRequest request = new ReportRequest();
request.setWorkspaceId(currentWorkspaceId);
@ -38,6 +38,8 @@ public class PerformanceReportController {
@PostMapping("/list/all/{goPage}/{pageSize}")
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);
return PageUtils.setPageInfo(page, reportService.getReportList(request));
}

View File

@ -35,13 +35,8 @@ public class ReportService {
@Resource
private LoadTestReportResultMapper loadTestReportResultMapper;
public List<LoadTestReport> getRecentReportList(ReportRequest request) {
LoadTestReportExample example = new LoadTestReportExample();
LoadTestReportExample.Criteria criteria = example.createCriteria();
//
example.setOrderByClause("update_time desc");
return loadTestReportMapper.selectByExample(example);
public List<ReportDTO> getRecentReportList(ReportRequest request) {
return extLoadTestReportMapper.getReportList(request);
}
public List<ReportDTO> getReportList(ReportRequest request) {