From 32889c5139b77575fa2cd6d4d1f5aea578ece160 Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期一, 16 五月 2022 15:58:19 +0800
Subject: [PATCH] 操作日志
---
dao/src/main/resources/mapper/PoleBindingMapper.xml | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/dao/src/main/resources/mapper/PoleBindingMapper.xml b/dao/src/main/resources/mapper/PoleBindingMapper.xml
index fd5c862..888d905 100644
--- a/dao/src/main/resources/mapper/PoleBindingMapper.xml
+++ b/dao/src/main/resources/mapper/PoleBindingMapper.xml
@@ -24,13 +24,18 @@
SELECT t2.*
FROM `pole_binding` t1
LEFT JOIN pole t2 ON t1.pole_id = t2.id
- WHERE t1.device_type = #{type}
- AND t1.device_code = #{Mac}
- <if test="userId != null">
- AND (
- t2.user_id = #{userId}
- OR t2.client_id = #{userId}
- )
- </if>
+ t1.device_code = #{Mac}
+ <where>
+ <if test="type != null">
+ AND t1.device_type = #{type}
+ </if>
+ <if test="userId != null">
+ AND (
+ t2.user_id = #{userId}
+ OR t2.client_id = #{userId}
+ )
+ </if>
+ </where>
+
</select>
</mapper>
--
Gitblit v1.9.3