From 5f1d1c462bbf49bc6a22b9e17b49733bcc1e0bc6 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期五, 20 六月 2025 19:01:13 +0800 Subject: [PATCH] zjh20250620 --- ltkj-system/src/main/resources/mapper/system/SysDeptMapper.xml | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ltkj-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ltkj-system/src/main/resources/mapper/system/SysDeptMapper.xml index 48f1f6a..f1e88c1 100644 --- a/ltkj-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ltkj-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -44,6 +44,8 @@ <result property="deptTypeCode" column="dept_type_code"/> <result property="deptFcusTypeCode" column="dept_fcus_type_code"/> <result property="modality" column="modality"/> + <result property="hisksid" column="hisksid"/> + <result property="hisksmc" column="hisksmc"/> </resultMap> <sql id="selectDeptVo"> @@ -81,7 +83,9 @@ d.standard_dept_code, d.dept_type_code, d.dept_fcus_type_code, - d.modality + d.modality, + d.hisksid, + d.hisksmc from sys_dept d </sql> @@ -203,6 +207,8 @@ <if test="createBy != null and createBy != ''">create_by,</if> <if test="modality != null and modality != ''">modality,</if> + <if test="hisksid != null and hisksid != ''">hisksid,</if> + <if test="hisksmc != null and hisksmc != ''">hisksmc,</if> create_time )values( <if test="deptId != null and deptId != 0">#{deptId},</if> @@ -240,6 +246,8 @@ <if test="createBy != null and createBy != ''">#{createBy},</if> <if test="modality != null and modality != ''">#{modality},</if> + <if test="hisksid != null and hisksid != ''">#{hisksid},</if> + <if test="hisksmc != null and hisksmc != ''">#{hisksmc},</if> sysdate() ) </insert> @@ -282,6 +290,8 @@ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="modality != null and modality != ''">modality = #{modality},</if> + <if test="hisksid != null and hisksid != ''">hisksid = #{hisksid},</if> + <if test="hisksmc != null and hisksmc != ''">hisksmc = #{hisksmc},</if> update_time = sysdate() </set> where dept_id = #{deptId} @@ -309,7 +319,7 @@ <delete id="deleteDeptById" parameterType="Long"> update sys_dept - set deleted = '2' + set deleted = '1' where dept_id = #{deptId} </delete> @@ -374,5 +384,19 @@ #{totalRows,mode=OUT,jdbcType=INTEGER} )} </select> + <select id="getDeptTreeById" resultType="java.lang.Long"> + WITH RECURSIVE dept_tree AS ( + SELECT dept_id + FROM sys_dept + WHERE dept_id = #{deptId} + + UNION ALL + + SELECT d.dept_id + FROM sys_dept d + INNER JOIN dept_tree dt ON d.parent_id = dt.dept_id + ) + SELECT dept_id FROM dept_tree; + </select> </mapper> -- Gitblit v1.8.0