From b5dc1a4096dc2379e68644936a7619cbd3468ab4 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Wed, 26 Apr 2023 11:06:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E4=BF=9D=E5=AD=98=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E6=8A=A5=E5=91=8A=E6=97=B6=E5=90=8C=E6=97=B6=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=AF=B9=E5=BA=94=E7=9A=84=E6=9C=80=E6=96=B0=E6=8A=A5?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 测试计划保存实时报告时同时保存对应的最新报告 --- .../ext/ExtApiDefinitionExecResultMapper.java | 2 ++ .../ext/ExtApiDefinitionExecResultMapper.xml | 21 ++++++++++++------- .../plan/TestPlanScenarioCaseService.java | 16 ++++++++++++++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java index 97f09dc255..9f62a599be 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java @@ -21,6 +21,8 @@ public interface ExtApiDefinitionExecResultMapper { ApiDefinitionExecResultWithBLOBs selectMaxResultByResourceId(String resourceId); + String selectMaxResultIdByResourceId(String resourceId); + ApiDefinitionExecResultWithBLOBs selectMaxResultByResourceIdAndType(String resourceId, String type); long countByProjectIDAndCreateInThisWeek(@Param("projectId") String projectId, @Param("version") String version, @Param("firstDayTimestamp") long firstDayTimestamp, @Param("lastDayTimestamp") long lastDayTimestamp); diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml index 2098f279d3..6f43f9848e 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml @@ -12,7 +12,16 @@ select * from api_definition_exec_result where resource_id = #{resourceId,jdbcType=VARCHAR} - ORDER BY create_time DESC LIMIT 1 + ORDER BY create_time DESC + LIMIT 1 + +