fix(接口测试): 修复接口导入,原接口下的case不见的缺陷

--bug=1034124 --user=王孝刚 【接口测试】github#28129,开启接口定义url可重复,将带case的api导出,再导入到其他目录,原api下的case都不见了 https://www.tapd.cn/55049933/s/1451974
This commit is contained in:
wxg0103 2024-01-16 16:51:49 +08:00 committed by wxg0103
parent d3e16991d8
commit 32a41d56e8

View File

@ -1252,7 +1252,7 @@
</select>
<select id="selectRepeatByBLOBsSameUrl" resultType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
SELECT * from api_definition
<include refid="Same_Where_Clause"/>
<include refid="Same_Where_Clause_Same" />
and status != 'TRASH'
and project_id = #{projectId}
<if test="moduleId != null">
@ -1330,6 +1330,31 @@
</where>
</sql>
<sql id="Same_Where_Clause_Same">
<where>
<if test="blobs">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="blobs" item="blob" separator="or">
<trim prefix="(" prefixOverrides="and" suffix=")">
<if test="blob.method">
and api_definition.method = #{blob.method}
</if>
<if test="blob.path">
and api_definition.path = #{blob.path}
</if>
<if test="blob.name">
and api_definition.name = #{blob.name}
</if>
<if test="blob.modulePath">
and api_definition.module_path = #{blob.modulePath}
</if>
</trim>
</foreach>
</trim>
</if>
</where>
</sql>
<sql id="relevanceApiCombine">
<if test='${condition}.name != null and (${name} == null or ${name} == "")'>
and atc.name