From ebecb50ecf3c53428fac4f3bd09d98110d6bc8d7 Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期三, 11 五月 2022 11:41:17 +0800
Subject: [PATCH] 设备归属

---
 dao/src/main/resources/mapper/PoleBindingMapper.xml |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dao/src/main/resources/mapper/PoleBindingMapper.xml b/dao/src/main/resources/mapper/PoleBindingMapper.xml
index cd53447..fd5c862 100644
--- a/dao/src/main/resources/mapper/PoleBindingMapper.xml
+++ b/dao/src/main/resources/mapper/PoleBindingMapper.xml
@@ -23,8 +23,14 @@
     <select id="getPoleByBinding" resultType="com.sandu.ximon.dao.domain.Pole">
         SELECT t2.*
         FROM `pole_binding` t1
-                 LEFT JOIN pole t2 ON t1.pole_id = t2.id
+        LEFT JOIN pole t2 ON t1.pole_id = t2.id
         WHERE t1.device_type = #{type}
-          AND t1.device_code = #{Mac}
+        AND t1.device_code = #{Mac}
+        <if test="userId != null">
+            AND (
+            t2.user_id = #{userId}
+            OR t2.client_id = #{userId}
+            )
+        </if>
     </select>
 </mapper>

--
Gitblit v1.9.3