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:
parent
bf8c39cee3
commit
3899c4be50
|
@ -1020,20 +1020,24 @@
|
||||||
</select>
|
</select>
|
||||||
<sql id="Same_Where_Clause">
|
<sql id="Same_Where_Clause">
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="blobs" item="blob" separator="or">
|
<if test="blobs">
|
||||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
<if test="blob.method">
|
<foreach collection="blobs" item="blob" separator="or">
|
||||||
and api_definition.method = #{blob.method}
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
</if>
|
<if test="blob.method">
|
||||||
<if test="blob.path">
|
and api_definition.method = #{blob.method}
|
||||||
and api_definition.path = #{blob.path}
|
</if>
|
||||||
</if>
|
<if test="blob.path">
|
||||||
<if test="blob.projectId">
|
and api_definition.path = #{blob.path}
|
||||||
and api_definition.project_id = #{blob.projectId}
|
</if>
|
||||||
</if>
|
<if test="blob.projectId">
|
||||||
</trim>
|
and api_definition.project_id = #{blob.projectId}
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
|
||||||
</foreach>
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -786,17 +786,22 @@
|
||||||
|
|
||||||
<sql id="Same_Where_Clause">
|
<sql id="Same_Where_Clause">
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="blobs" item="blob" separator="or">
|
<if test="blobs">
|
||||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
<if test="blob.name">
|
<foreach collection="blobs" item="blob" separator="or">
|
||||||
and api_scenario.name = #{blob.name}
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
</if>
|
<if test="blob.name">
|
||||||
<if test="blob.projectId">
|
and api_scenario.name = #{blob.name}
|
||||||
and api_scenario.project_id = #{blob.projectId}
|
</if>
|
||||||
</if>
|
<if test="blob.projectId">
|
||||||
</trim>
|
and api_scenario.project_id = #{blob.projectId}
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
|
||||||
</foreach>
|
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue