From 2016c6f7ff0def562d98472ad54013567efe2b73 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 10 六月 2026 15:28:56 +0800
Subject: [PATCH] feat(approve): 添加审批实例ID精确查询条件

---
 src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml b/src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml
index 267de0b..f4d6284 100644
--- a/src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml
+++ b/src/main/resources/mapper/account/purchase/AccountPaymentApplicationMapper.xml
@@ -88,12 +88,14 @@
     </select>
 
     <select id="existsByStockInRecordId" resultType="java.lang.Boolean">
-         SELECT COUNT(*) > 0
+        SELECT COUNT(*) > 0
         FROM account_payment_application
-        WHERE  status != 2
-        <foreach collection="stockInRecordIds" item="id" open="(" separator=" OR " close=")">
-            FIND_IN_SET(#{id}, stock_in_record_ids)
-        </foreach>
+        WHERE status != 2
+        AND (
+            <foreach collection="stockInRecordIds" item="id" separator=" OR ">
+                FIND_IN_SET(#{id}, stock_in_record_ids) > 0
+            </foreach>
+        )
     </select>
 
 </mapper>

--
Gitblit v1.9.3