From 6427886a12c3c6cd56c5dde2e3437d0d608da59c Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 09 十一月 2026 14:23:48 +0800
Subject: [PATCH] 修复管理员科室病区为空与延续护理任务出院维度过滤
---
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml | 39 +++++++++++++++++++++++++++++----------
1 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
index 225eac3..cf4e077 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -283,17 +283,36 @@
where dept_id = #{deptId}
</delete>
+ <!--
+ 鏌ヨ绉戝/鐥呭尯锛�
+ 路 userId 鏈夊�硷紙鏅�氱敤鎴� / 鐢ㄦ埛缂栬緫椤碉細鏌ユ煇涓敤鎴峰悕涓嬬殑閮ㄩ棬锛夆啋 鍏宠仈 sys_user_dept锛�
+ 路 userId 涓虹┖锛堢鐞嗗憳锛氱湅鏈満鏋勫叏閮ㄧ瀹�/鐥呭尯锛夆啋 鍙煡 sys_dept锛屼笉鍏宠仈鍏崇郴琛ㄣ��
+ 涓轰粈涔堣鍒嗘敮锛欻IS 閲囬泦鍐� sys_user_dept 鏃舵槑纭帓闄や簡 admin锛圕ollectHISMapper 鐨�
+ yhyksxx/yhybfxx 閮芥湁 ud.user_id != 'admin'锛夛紝绠$悊鍛樺湪鍏崇郴琛ㄩ噷娌℃湁鏁版嵁锛岃蛋 inner join
+ 浼氬緱鍒扮┖鍒楄〃锛岃〃鐜板氨鏄�岀櫥褰曟垚鍔熶絾鍒涘缓浠诲姟鏃堕�変笉鍒扮瀹ょ梾鍖恒�嶃��
+ 鍙﹀涓嶅仛闄㈠尯杩囨护锛堢鐞嗗憳璺ㄩ櫌鍖猴級锛岄櫌鍖洪殧绂诲彧瀵规櫘閫氱敤鎴风敓鏁堛��
+ -->
<select id="selectSysDeptListBySysUserDept" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept"
resultMap="SysDeptResult">
- <include refid="selectDeptVo"/>
- inner join sys_user_dept ud
- on d.dept_code = ud.dept_code
- where 1=1
- and d.del_flag = 0
- and ud.del_flag = 0
- <if test="orgid != null">and d.orgid = #{orgid} and ud.orgid = #{orgid}</if>
- <if test="campusid != null">and d.campusid = #{campusid}</if>
- <if test="userId != null">and ud.user_id = #{userId}</if>
- <if test="deptType != null and deptType != ''">and d.dept_type = #{deptType}</if>
+ <choose>
+ <when test="userId != null">
+ <include refid="selectDeptVo"/>
+ inner join sys_user_dept ud
+ on d.dept_code = ud.dept_code
+ where 1=1
+ and d.del_flag = 0
+ and ud.del_flag = 0
+ <if test="orgid != null">and d.orgid = #{orgid} and ud.orgid = #{orgid}</if>
+ <if test="campusid != null">and d.campusid = #{campusid}</if>
+ <if test="deptType != null and deptType != ''">and d.dept_type = #{deptType}</if>
+ and ud.user_id = #{userId}
+ </when>
+ <otherwise>
+ <include refid="selectDeptVo"/>
+ where d.del_flag = 0
+ <if test="orgid != null">and d.orgid = #{orgid}</if>
+ <if test="deptType != null and deptType != ''">and d.dept_type = #{deptType}</if>
+ </otherwise>
+ </choose>
</select>
</mapper>
--
Gitblit v1.9.3