From 49e1bc66ebaf696ebd3fc3ed33d65c8795fd3cde Mon Sep 17 00:00:00 2001 From: liding <756868258@qq.com> Date: 星期二, 01 七月 2025 18:05:12 +0800 Subject: [PATCH] 1.巡检定时任务 2.设备管理 3.文档查询 --- ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 44 insertions(+), 0 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index a41723f..b91baa4 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -144,6 +144,50 @@ <select id="selectUserListAll" resultType="com.ruoyi.common.core.domain.entity.SysUser"> select user_id, nick_name from sys_user where del_flag = '0' </select> + <select id="selectList" resultType="com.ruoyi.common.core.domain.entity.SysUser"> + SELECT user_id, nick_name FROM sys_user + <where> + <if test="list != null and list.size() > 0"> + user_id IN + <foreach item="id" collection="list" open="(" separator="," close=")"> + #{id} + </foreach> + </if> + <if test="list == null or list.size() == 0"> + 1=0 <!-- 绌哄垪琛ㄦ椂杩斿洖绌虹粨鏋� --> + </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 into sys_user( -- Gitblit v1.9.3