From 7462ddb848226a79bb9a60ed4e1632f63da4a99e Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 01 Dec 2021 17:21:34 +0800
Subject: [PATCH] 部门树修改
---
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml | 76 +++++++++++++++++++++++++++++++++++++
1 files changed, 75 insertions(+), 1 deletions(-)
diff --git a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
index 84135c1..a0561e9 100644
--- a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -176,7 +176,12 @@
and bu.nativeplace = #{user.nativeplace}
</if>
<if test="user.examinationType!=null and user.examinationType != ''">
- and bu.examination_type = #{user.examinationType}
+ <if test="user.examinationType == 0">
+ and (bu.examination_type = #{user.examinationType} or bu.examination_type is null or bu.examination_type ='')
+ </if>
+ <if test="user.examinationType == 1">
+ and bu.examination_type = #{user.examinationType}
+ </if>
</if>
<if test="user.sex!=null and user.sex != ''">
and bu.sex = #{user.sex}
@@ -221,6 +226,12 @@
and bd.id != 1432625856013971457
<if test="user.cardid!=null and user.cardid != ''">
and bu.cardid like concat(concat('%', #{user.cardid}),'%')
+ </if>
+ <if test="user.examinationType==0">
+ and (bu.examination_type = #{user.examinationType} or bu.examination_type is null or bu.examination_type="")
+ </if>
+ <if test="user.examinationType==1">
+ and bu.examination_type = #{user.examinationType}
</if>
<if test="user.realName!=null and user.realName != ''">
and bu.real_name like concat(concat('%', #{user.realName}),'%')
@@ -326,6 +337,69 @@
SELECT id, name, real_name RealName
FROM blade_user
where cardid = #{param1}
+ and is_deleted = 0
+ and status = 1
+ </select>
+
+
+
+ <select id="selectPeo" resultType="java.util.HashMap">
+ select
+ bu.*,
+ ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age,
+ bd.dept_name as deptName
+ from
+ blade_user bu
+ left join
+ blade_dept bd
+ on
+ bu.dept_id = bd.id
+ left join
+ blade_role br
+ on
+ br.id = bu.role_id
+ left join
+ sys_information si
+ on
+ si.departmentid = bd.id
+ left join
+ sys_jurisdiction sj
+ on
+ sj.id = si.jurisdiction
+ where
+ bu.is_deleted = 0
+ and
+ br.role_alias = "安保人员"
+ and
+ bu.status = 1
+ and bd.parent_id!=1425365577303621633
+ and bd.id != 1425365577303621633
+ and bd.id != 1432625856013971457
+ <if test="user.deptId!=null and user.deptId!=''">
+ and bd.id in
+ (
+ select id from blade_dept where id = #{user.deptId}
+ union
+ SELECT
+ id
+ FROM
+ (
+ SELECT
+ t1.id,t1.parent_id,t1.dept_name,
+ IF
+ ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild
+ FROM
+ ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1,
+ ( SELECT @pids := #{user.deptId} ) t2
+ ) t3
+ WHERE
+ ischild != 0
+ )
+ </if>
+ <if test="user.type!=null">
+ and bu.equipment_code is not null
+ </if>
+
</select>
</mapper>
--
Gitblit v1.9.3