From 256f758a45c9b00a9248b02345ee1d6f52869e08 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期三, 05 十一月 2025 09:36:58 +0800
Subject: [PATCH] yys 1.导出接口开发 2.营销管理-回款登记-回款状态(回款完成,未完成) 3.采购管理-付款登记-加一个付款进度 4.采购管理-付款流水-采购合同号筛选 5.仓储物流-所有-查询条件加一个日期 6.仓储物流-入库管理-加一个库存预警数量字段 7.生产管控-生产订单-加一个订单状态-已完成、未完成 8.协同办公-通知公告-加一个时间限制,过时后状态改为已过期
---
src/main/resources/mapper/system/SysDeptMapper.xml | 27 +++++++++++++++++++++++++--
1 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/src/main/resources/mapper/system/SysDeptMapper.xml b/src/main/resources/mapper/system/SysDeptMapper.xml
index 6f70f9d..5c6310a 100644
--- a/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -60,13 +60,14 @@
<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 dept_name from sys_dept where dept_id = d.parent_id) parent_name
+ (select dept_name from sys_dept where dept_id = d.parent_id) parent_name,
+ d.dept_nick
from sys_dept d
where d.dept_id = #{deptId}
</select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
- select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
+ select count(1) from sys_user_dept where dept_id = #{deptId}
</select>
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
@@ -97,6 +98,7 @@
<if test="leader != null and leader != ''">leader,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="email != null and email != ''">email,</if>
+ <if test="deptNick != null and deptNick != ''">dept_nick,</if>
<if test="status != null">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
@@ -109,6 +111,7 @@
<if test="leader != null and leader != ''">#{leader},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
+ <if test="deptNick != null and deptNick != '' ">#{deptNick},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
@@ -125,6 +128,7 @@
<if test="leader != null">leader = #{leader},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
+ <if test="deptNick != null and deptNick != '' ">dept_nick = #{deptNick},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
@@ -156,4 +160,23 @@
update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
+ <select id="maxLevelDeptId">
+ WITH RECURSIVE DepartmentHierarchy AS (
+ SELECT dept_id, parent_id
+ FROM sys_dept
+ WHERE dept_id = #{deptId}
+
+ UNION ALL
+
+ -- 閫掑綊鎯呭喌锛氬姞鍏ュ綋鍓嶉儴闂ㄧ殑鐖剁骇閮ㄩ棬
+ SELECT d.dept_id, d.parent_id
+ FROM sys_dept d
+ INNER JOIN DepartmentHierarchy dh ON d.dept_id = dh.parent_id
+ )
+ -- 鏌ヨ鏈�椤剁骇鐨勭埗绾ч儴闂↖D
+ SELECT dept_id as top_level_department_id
+ FROM DepartmentHierarchy
+ WHERE parent_id = 100;
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3