From bac50872dc8d80fd8c3879f02aa98084db4d6cc8 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 26 十月 2026 21:53:07 +0800
Subject: [PATCH] fix(basic): 超级管理员查询客户不再受领用/共享范围限制

---
 src/main/resources/mapper/basic/CustomerMapper.xml |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/main/resources/mapper/basic/CustomerMapper.xml b/src/main/resources/mapper/basic/CustomerMapper.xml
index eccb09f..f05c22d 100644
--- a/src/main/resources/mapper/basic/CustomerMapper.xml
+++ b/src/main/resources/mapper/basic/CustomerMapper.xml
@@ -45,8 +45,9 @@
             </if>
             <!-- 绉佹捣鏌ヨ锛歵ype = 0锛堢娴峰鎴凤級鎴栬�� type = 1锛堝叕娴峰鎴凤級涓斿凡琚垎閰嶏紝骞朵笖鏄嚜宸遍鐢ㄣ�佽嚜宸卞垱寤烘垨鑰呭叡浜粰鑷繁鐨勫鎴� -->
             <if test="c.type != null and c.type == 0">
-                and (
-                    (type = #{c.type} or (type = 1 and is_assigned = 1))
+                and (type = #{c.type} or (type = 1 and is_assigned = 1))
+                <!-- loginUserId 涓虹┖琛ㄧず瓒呯骇绠$悊鍛橈紝涓嶅彈棰嗙敤/鍏变韩鑼冨洿闄愬埗 -->
+                <if test="loginUserId != null">
                     and (
                         c.usage_user = #{loginUserId}
                         or c.create_user = #{loginUserId}
@@ -56,7 +57,7 @@
                             and cu.user_id = #{loginUserId}
                         )
                     )
-                )
+                </if>
             </if>
         </where>
         order by c.id desc
@@ -107,8 +108,9 @@
             </if>
             <!-- 绉佹捣鏌ヨ锛歵ype = 0锛堢娴峰鎴凤級鎴栬�� type = 1锛堝叕娴峰鎴凤級涓斿凡琚垎閰嶏紝骞朵笖鏄嚜宸遍鐢ㄣ�佽嚜宸卞垱寤烘垨鑰呭叡浜粰鑷繁鐨勫鎴� -->
             <if test="c.type != null and c.type == 0">
-                and (
-                    (type = #{c.type} or (type = 1 and is_assigned = 1))
+                and (type = #{c.type} or (type = 1 and is_assigned = 1))
+                <!-- loginUserId 涓虹┖琛ㄧず瓒呯骇绠$悊鍛橈紝涓嶅彈棰嗙敤/鍏变韩鑼冨洿闄愬埗 -->
+                <if test="loginUserId != null">
                     and (
                         c.usage_user = #{loginUserId}
                         or c.create_user = #{loginUserId}
@@ -118,7 +120,7 @@
                             and cu.user_id = #{loginUserId}
                         )
                     )
-                )
+                </if>
             </if>
         </where>
         order by c.id desc

--
Gitblit v1.9.3