fix(接口测试): 场景引用场景列表排除当前场景

This commit is contained in:
AgAngle 2024-04-07 20:07:28 +08:00 committed by Craftsman
parent 35e9c4828f
commit fce4f17571
2 changed files with 11 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import jakarta.validation.constraints.Size;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Data @Data
@ -35,4 +36,7 @@ public class ApiScenarioPageRequest extends BasePageRequest {
@Schema(description = "删除状态(状态为 1 时为回收站数据)") @Schema(description = "删除状态(状态为 1 时为回收站数据)")
private Boolean deleted = false; private Boolean deleted = false;
@Schema(description = "查询时排除的ID")
private List<String> excludeIds = new ArrayList<>();
} }

View File

@ -34,6 +34,13 @@
LEFT JOIN project_version ON project_version.id = api_scenario.version_id LEFT JOIN project_version ON project_version.id = api_scenario.version_id
where api_scenario.deleted = #{request.deleted} where api_scenario.deleted = #{request.deleted}
<include refid="queryWhereCondition"/> <include refid="queryWhereCondition"/>
<if test="request.excludeIds != null and request.excludeIds.size() > 0">
and api_scenario.id not in
<foreach collection="request.excludeIds" item="excludeId" separator="," open="(" close=")">
#{excludeId}
</foreach>
</if>
</select> </select>
<select id="getIds" resultType="java.lang.String"> <select id="getIds" resultType="java.lang.String">