From 3ef1cf899c2bf558b934fd2c5dfdf0a970df8c43 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期五, 29 八月 2025 15:22:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/pim-jlmy' into pim-jlmy
---
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index 8cbe2d3..b91baa4 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -158,8 +158,38 @@
</if>
</where>
</select>
+ <select id="selectUsersByIds" resultType="com.ruoyi.common.core.domain.entity.SysUser">
+ SELECT user_id, nick_name
+ FROM sys_user
+ WHERE user_id IN
+ <foreach collection="userIds" item="id" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </select>
+ <select id="selectBatchIds" resultType="com.ruoyi.common.core.domain.entity.SysUser">
+ SELECT * FROM sys_user
+ <!-- 澶勭悊绌洪泦鍚堬細鑻� userIds 涓虹┖锛屼笉鎵ц WHERE 鏉′欢锛堥伩鍏� SQL 璇硶閿欒锛� -->
+ <where>
+ <if test="userIds != null and userIds.size() > 0">
+ user_id = ANY(
+ <foreach collection="userIds" item="id" open="ARRAY[" separator="," close="]">
+ #{id}
+ </foreach>
+ )
+ </if>
+ </where>
+ <!-- 鎺掑簭锛氭寜浼犲叆鐨� userIds 椤哄簭杩斿洖缁撴灉锛圥ostgreSQL 涓撶敤锛� -->
+ <if test="userIds != null and userIds.size() > 0">
+ ORDER BY array_position(
+ <foreach collection="userIds" item="id" open="ARRAY[" separator="," close="]" index="index">
+ #{id}
+ </foreach>,
+ user_id -- 琛ㄤ腑鐨� id 瀛楁锛屼笌鏁扮粍涓殑鍏冪礌鍖归厤
+ )
+ </if>
+ </select>
- <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
+ <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>
--
Gitblit v1.9.3