From 1bf4f952b35ee870082e0ec0b1026f47121fe2fe Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 04 Jan 2022 15:42:01 +0800
Subject: [PATCH] 按年龄段查询保安员分布情况
---
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 110 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
index 7437ddc..3ae22e0 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -89,7 +89,7 @@
and is_deleted = 0
and role_id = '1412226235153731586'
AND status=1
- AND dispatch=0
+ AND dispatch='0'
GROUP BY dept_id
) C
ON C.dept_id = i.departmentid
@@ -124,7 +124,7 @@
<if test="information.createDeptId!=null and information.createDeptId!=''">
and bu.dept_id =#{information.createDeptId}
</if>
- order by i.id desc
+ order by i.establishTime asc
</select>
<delete id="deleteIn">
@@ -573,7 +573,7 @@
and status = 1
and is_deleted = 0
and role_id = "1412226235153731586"
- and dispatch = 0
+ and dispatch = '0'
GROUP BY
dept_id
) F
@@ -869,7 +869,7 @@
bu.`status` = 1
AND bu.is_deleted = 0
AND bu.role_id = '1412226235153731586'
- AND bu.dispatch = 0
+ AND bu.dispatch = '0'
GROUP BY
bu.dept_id
) C ON C.dept_id = A.departmentid
@@ -883,7 +883,7 @@
bu.`status` = 1
AND bu.is_deleted = 0
AND bu.role_id = '1412226235153731586'
- AND bu.dispatch = 1
+ AND (bu.dispatch = '1' or bu.dispatch is null or bu.dispatch = '')
GROUP BY
bu.dept_id
) D ON D.dept_id = A.departmentid
@@ -1039,7 +1039,7 @@
bu.`status` = 1
AND bu.is_deleted = 0
AND bu.role_id = '1412226235153731586'
- AND bu.dispatch = 0
+ AND bu.dispatch = '0'
GROUP BY
bu.dept_id
) C ON C.dept_id = A.departmentid
@@ -1053,7 +1053,7 @@
bu.`status` = 1
AND bu.is_deleted = 0
AND bu.role_id = '1412226235153731586'
- AND bu.dispatch = 1
+ AND (bu.dispatch = '1' or bu.dispatch is null or dispatch='')
GROUP BY
bu.dept_id
) D ON D.dept_id = A.departmentid
@@ -1215,7 +1215,7 @@
and status = 1
and is_deleted = 0
and role_id = "1412226235153731586"
- and dispatch = 0
+ and dispatch = '0'
GROUP BY
dept_id
) F
@@ -1241,4 +1241,106 @@
</if>
</select>
+ <!--保安人员详情-->
+ <select id="selectUIn" resultType="java.util.HashMap">
+ SELECT
+ u.real_name,
+ u.securitynumber,
+ u.cardid,
+ u.phone,
+ u.hold,
+ u.soil,
+ u.photo,
+ u.examination_type,
+ u.dispatch,
+ bd.dept_name enterpriseName
+ FROM
+ blade_user u
+ LEFT JOIN blade_dept bd ON bd.id = u.dept_id
+ WHERE
+ u.role_id = '1412226235153731586'
+ AND u.is_deleted = 0
+ AND u.`status` = 1
+ and bd.is_deleted = 0
+ <if test="deptid!=null and deptid!=''">
+ and bd.id in
+ (
+ select id from blade_dept where id = #{deptid}
+ union all
+ (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 := #{deptid} ) t2
+ ) t3
+ WHERE
+ ischild != 0
+ )
+ )
+ </if>
+ <if test="name!=null and name!=''">
+ and real_name like concat('%', #{name},'%')
+ </if>
+ <if test="hold!=null and hold!=''">
+ <if test="hold==0">
+ and hold=#{hold}
+ </if>
+ <if test="hold==1">
+ and hold=#{hold}
+ </if>
+ </if>
+ <if test="photo!=null and photo!=''">
+ <if test="photo==0">
+ AND avatar is not null and avatar!=""
+ </if>
+ <if test="photo==1">
+ AND (avatar is null or avatar = "")
+ </if>
+ </if>
+ <if test="examinationtype!=null and examinationtype!=''">
+ and examination_type=#{examinationtype}
+ </if>
+ <if test="dispatch!=null and dispatch!=''">
+ and dispatch=#{dispatch}
+ </if>
+ <if test="soil !=null and soil !=''">
+ and soil =#{soil}
+ </if>
+ </select>
+
+ <!--查询学历统计信息-->
+ <select id="getEducationStatistics" resultType="java.util.HashMap">
+ SELECT
+ ifnull(b.num,0) value,a.dict_value name
+ FROM
+ ( SELECT dict_key, dict_value FROM blade_dict_biz WHERE CODE = "educationType" AND parent_id = 1442114073897521153 ) a
+ LEFT JOIN (
+ SELECT
+ count( * ) num,
+ education
+ FROM
+ blade_user bu
+ left join blade_dept bd on bu.dept_id = bd.id
+ left join sys_information si on si.departmentid = bd.id
+ left join sys_jurisdiction sj on sj.id = si.jurisdiction
+ where 1=1
+ and bu.role_id = 1412226235153731586
+ and bu.status = 1
+ and bu.is_deleted = 0
+ <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction!='1372091709474910209'">
+ and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction})
+ </if>
+ <if test="deptId!=null and deptId != ''">
+ and bu.dept_id = #{deptId}
+ </if>
+ GROUP BY
+ education ) b ON a.dict_key = b.education
+ </select>
+
</mapper>
--
Gitblit v1.9.3