diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseScheduleMapper.xml b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseScheduleMapper.xml index 8329338cd6..f2d0187088 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseScheduleMapper.xml +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseScheduleMapper.xml @@ -55,10 +55,10 @@ SELECT COUNT(id) AS countNumber FROM `schedule` WHERE resource_id IN ( - SELECT scene.id - FROM api_scenario scene - WHERE scene.project_id = #{projectId,jdbcType=VARCHAR} - AND scene.status != 'Trash' + SELECT scene.id + FROM api_scenario scene + WHERE scene.project_id = #{projectId,jdbcType=VARCHAR} + AND scene.status != 'Trash' AND version_id = #{versionId} @@ -66,29 +66,29 @@ AND latest = 1 ) - AND create_time BETWEEN #{startTime} AND #{endTime} + AND create_time BETWEEN #{startTime} AND #{endTime} SELECT sch.id AS taskID, sch.`name` AS `name`, - sch.`value` AS rule, - sch.`enable` AS `taskStatus`, + sch.`value` AS rule, + sch.`enable` AS `taskStatus`, sch.update_time AS updateTime, - sch.id AS taskID, - sch.`value` AS rule, - sch.`enable` AS `taskStatus`, - u.`name` AS creator, + sch.id AS taskID, + sch.`value` AS rule, + sch.`enable` AS `taskStatus`, + u.`name` AS creator, sch.update_time AS updateTime, - sch.type AS taskType, - sch.`group` AS taskGroup, - sch.resource_id AS scenarioId + sch.type AS taskType, + sch.`group` AS taskGroup, + sch.resource_id AS scenarioId FROM ( schedule sch left join user u ON sch.user_id = u.id ) WHERE sch.`enable` = true AND sch.project_id = #{projectId,jdbcType=VARCHAR} - AND ( sch.group IN ('SWAGGER_IMPORT') @@ -137,8 +136,11 @@ AND sch.group IN ('API_SCENARIO_TEST','SWAGGER_IMPORT') + ORDER BY sch.update_time DESC - update schedule set name = #{name} where resource_id = #{resourceId} + update schedule + set name = #{name} + where resource_id = #{resourceId}