From cd0e4e030b14795d07e50df0f336c6fb6536a8be Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Thu, 09 Oct 2025 18:04:42 +0800
Subject: [PATCH] sql
---
trading-order-service/src/main/resources/mapper/UserMapper.xml | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/trading-order-service/src/main/resources/mapper/UserMapper.xml b/trading-order-service/src/main/resources/mapper/UserMapper.xml
index 6a97229..4414f22 100644
--- a/trading-order-service/src/main/resources/mapper/UserMapper.xml
+++ b/trading-order-service/src/main/resources/mapper/UserMapper.xml
@@ -45,12 +45,11 @@
#{r}
</foreach>
- <if test="userCode!=null and userCode!=''">
- and u.user_code=#{userCode}
- </if>
-
+<!-- <if test="userCode!=null and userCode!=''">-->
+<!-- and u.user_code=#{userCode}-->
+<!-- </if>-->
<if test="userName!=null and userName!=''">
- and u.user_name=#{userName}
+ and u.user_name=#{userName} or u.user_code=#{userName}
</if>
<if test="checkedList!=null">
@@ -91,18 +90,21 @@
tz_user r
ON u.user_recom=r.user_id
- where 1=1 and u.role_name in
- <foreach collection="roleNames" separator="," index="index" open="(" close=")" item="r">
- #{r}
- </foreach>
-
- <if test="checkedList!=null">
- and u.user_id in
- <foreach collection="checkedList" separator="," index="index" open="(" close=")" item="r">
- #{r}
+ where 1=1
+ <if test="roleNames != null and roleNames.size() > 0">
+ AND u.role_name IN
+ <foreach collection="roleNames" separator="," open="(" close=")" item="r">
+ #{r}
</foreach>
-
</if>
+
+ <if test="checkedList != null and checkedList.size() > 0">
+ AND u.user_id IN
+ <foreach collection="checkedList" separator="," open="(" close=")" item="r">
+ #{r}
+ </foreach>
+ </if>
+
<if test="userCode!=null and userCode!=''">
and u.user_code=#{userCode}
</if>
--
Gitblit v1.9.3