From 14c7f8f9ab3dfca1a8759482a9b3e16cd5d9856f Mon Sep 17 00:00:00 2001 From: 李林 <z1292839451@163.com> Date: 星期六, 20 四月 2024 00:06:03 +0800 Subject: [PATCH] 标准刷新增加一个条件 --- cnas-server/src/main/resources/mapper/DepartmentMapper.xml | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cnas-server/src/main/resources/mapper/DepartmentMapper.xml b/cnas-server/src/main/resources/mapper/DepartmentMapper.xml index 465bbc1..d29cd93 100644 --- a/cnas-server/src/main/resources/mapper/DepartmentMapper.xml +++ b/cnas-server/src/main/resources/mapper/DepartmentMapper.xml @@ -18,7 +18,10 @@ </select> <select id="showUserById" resultType="com.yuanchu.mom.dto.UserDto"> select * from (select id, name, age, email, phone,depart_id - from user where FIND_IN_SET( SUBSTRING_INDEX(depart_id, ',', -1) ,#{ids}) > 0 ) a + from user where state=1 and SUBSTRING_INDEX(depart_id, ',', -1) in + <foreach collection="ids" item="id" separator="," open="(" close=")"> + #{id} + </foreach> ) a <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> ${ew.customSqlSegment} </if> @@ -34,6 +37,7 @@ JOIN DepartmentHierarchy dh ON d.father_id = dh.id ) SELECT id - FROM DepartmentHierarchy; + FROM DepartmentHierarchy + order by id desc; </select> </mapper> -- Gitblit v1.9.3