refactor(接口测试): 优化导入查询sql (#15309)

--task=1008278 --user=王孝刚
接口测试导入逻辑优化(1.20同步上)
https://www.tapd.cn/55049933/s/1187315

Co-authored-by: wxg0103 <727495428@qq.com>
This commit is contained in:
MeterSphere Bot 2022-06-28 11:33:25 +08:00 committed by GitHub
parent bf8c39cee3
commit 3899c4be50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 21 deletions

View File

@ -1020,20 +1020,24 @@
</select>
<sql id="Same_Where_Clause">
<where>
<foreach collection="blobs" item="blob" separator="or">
<if test="blobs">
<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.projectId">
and api_definition.project_id = #{blob.projectId}
</if>
</trim>
<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.projectId">
and api_definition.project_id = #{blob.projectId}
</if>
</trim>
</foreach>
</foreach>
</trim>
</if>
</where>
</sql>
</mapper>

View File

@ -786,17 +786,22 @@
<sql id="Same_Where_Clause">
<where>
<foreach collection="blobs" item="blob" separator="or">
<if test="blobs">
<trim prefix="(" prefixOverrides="and" suffix=")">
<if test="blob.name">
and api_scenario.name = #{blob.name}
</if>
<if test="blob.projectId">
and api_scenario.project_id = #{blob.projectId}
</if>
</trim>
<foreach collection="blobs" item="blob" separator="or">
<trim prefix="(" prefixOverrides="and" suffix=")">
<if test="blob.name">
and api_scenario.name = #{blob.name}
</if>
<if test="blob.projectId">
and api_scenario.project_id = #{blob.projectId}
</if>
</trim>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>