refactor(功能用例): 调整查询用例评审脑图查询语句

This commit is contained in:
guoyuqi 2024-07-10 12:33:16 +08:00 committed by 刘瑞斌
parent 8fd9a26a6a
commit 683c1b7963
1 changed files with 2 additions and 2 deletions

View File

@ -847,11 +847,11 @@
case_review_functional_case crfc case_review_functional_case crfc
LEFT JOIN functional_case fc ON crfc.case_id = fc.id LEFT JOIN functional_case fc ON crfc.case_id = fc.id
LEFT JOIN functional_case_blob fcb ON fcb.id = fc.id LEFT JOIN functional_case_blob fcb ON fcb.id = fc.id
LEFT JOIN ( SELECT crh.case_id, crh.`status`, crh.`create_user` from case_review_history crh where crh.review_id = #{request.reviewId} LEFT JOIN (select * from (SELECT crh.case_id, crh.`status`, ROW_NUMBER() OVER (PARTITION BY crh.case_id ORDER BY crh.create_time DESC) as rn from case_review_history crh where crh.review_id = #{request.reviewId}
<if test="viewStatusUserId != null and viewStatusUserId != ''"> <if test="viewStatusUserId != null and viewStatusUserId != ''">
AND crh.create_user = #{viewStatusUserId} AND crh.create_user = #{viewStatusUserId}
</if> </if>
order by crh.create_time desc limit 1 ) as history ON history.case_id = crfc.case_id order by crh.create_time desc ) as history_filter WHERE rn = 1 ) as history ON history.case_id = crfc.case_id
WHERE WHERE
crfc.review_id = #{request.reviewId} crfc.review_id = #{request.reviewId}
AND fc.deleted = #{deleted} AND fc.deleted = #{deleted}