From 848d609a35569b029bbdd5ab91c1df2a0f568819 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 09 一月 2026 09:04:03 +0800
Subject: [PATCH] 浪潮对接单点登录:租户数据隔离功能3

---
 src/main/resources/mapper/system/SysPostMapper.xml |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/mapper/system/SysPostMapper.xml b/src/main/resources/mapper/system/SysPostMapper.xml
index 177f74d..59fff7a 100644
--- a/src/main/resources/mapper/system/SysPostMapper.xml
+++ b/src/main/resources/mapper/system/SysPostMapper.xml
@@ -19,7 +19,7 @@
 	
 	<sql id="selectPostVo">
         select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark 
-		from sys_post
+		from sys_post p
     </sql>
 	
 	<select id="selectPostList" parameterType="com.ruoyi.project.system.domain.SysPost" resultMap="SysPostResult">
@@ -34,6 +34,8 @@
 			<if test="postName != null and postName != ''">
 				AND post_name like concat('%', #{postName}, '%')
 			</if>
+            <!-- 鏁版嵁鑼冨洿杩囨护 -->
+            ${params.dataScope}
 		</where>
 	</select>
 	
@@ -71,8 +73,14 @@
 		<include refid="selectPostVo"/>
 		 where post_code=#{postCode} limit 1
 	</select>
-	
-	<update id="updatePost" parameterType="com.ruoyi.project.system.domain.SysPost">
+    <select id="selectPostByTenantId" resultType="com.ruoyi.project.system.domain.SysPost">
+        <include refid="selectPostVo"/>
+        <where>
+            AND p.tenant_id = #{tenantId}
+        </where>
+    </select>
+
+    <update id="updatePost" parameterType="com.ruoyi.project.system.domain.SysPost">
  		update sys_post
  		<set>
  			<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
@@ -95,6 +103,7 @@
  			<if test="status != null and status != ''">status,</if>
  			<if test="remark != null and remark != ''">remark,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			<if test="tenantId != null and tenantId != ''">tenant_id,</if>
  			create_time
  		)values(
  			<if test="postId != null and postId != 0">#{postId},</if>
@@ -104,6 +113,7 @@
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
  			sysdate()
  		)
 	</insert>

--
Gitblit v1.9.3