From b46065a201c09ce69f111806f2bda4a5f476bc4e Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 18 十月 2025 17:20:22 +0800
Subject: [PATCH] fix:用户同步,机构同步
---
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
index cf439f6..b5fab18 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -16,6 +16,7 @@
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="parentName" column="parent_name" />
+ <result property="departmentId" column="department_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@@ -23,7 +24,7 @@
</resultMap>
<sql id="selectDeptVo">
- select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
+ select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.department_id, d.create_by, d.create_time
from sys_dept d
</sql>
@@ -59,7 +60,7 @@
</select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
- select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
+ select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.department_id,
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
from sys_dept d
where d.dept_id = #{deptId}
@@ -98,6 +99,7 @@
<if test="phone != null and phone != ''">phone,</if>
<if test="email != null and email != ''">email,</if>
<if test="status != null">status,</if>
+ <if test="departmentId != null">department_id,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
@@ -110,6 +112,7 @@
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if>
+ <if test="departmentId != null">#{departmentId},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
@@ -126,6 +129,7 @@
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if>
+ <if test="departmentId != null">department_id = #{departmentId},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
@@ -156,4 +160,20 @@
update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
+ <!-- 鏍规嵁departmentId鏌ヨ閮ㄩ棬 -->
+ <select id="selectDeptByDepartmentId" parameterType="Integer" resultMap="SysDeptResult">
+ <include refid="selectDeptVo"/>
+ where d.department_id = #{departmentId} and d.del_flag = '0'
+ limit 1
+ </select>
+
+ <!-- 鏍规嵁departmentId鍜岀埗閮ㄩ棬ID鏌ヨ閮ㄩ棬 -->
+ <select id="selectDeptByDepartmentIdAndParentId" resultMap="SysDeptResult">
+ <include refid="selectDeptVo"/>
+ where d.department_id = #{departmentId}
+ and d.parent_id = #{parentId}
+ and d.del_flag = '0'
+ limit 1
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1