From f9ff113e9d2e9a3e643b185f08652004e5e43d94 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 06 Dec 2021 16:19:37 +0800
Subject: [PATCH] 保安员统计导出,业务情况统计导出修改
---
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml | 108 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 85 insertions(+), 23 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 6541c99..48127a4 100644
--- a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -182,6 +182,12 @@
<if test="user.hold!=null and user.hold != ''">
and bu.hold = #{user.hold}
</if>
+ <if test="user.types!=null and user.types=='1'.toString()">
+ and to_days(bu.audit_time) = to_days(now())
+ </if>
+ <if test="user.types!=null and user.types=='2'.toString()">
+ and DATE_FORMAT(bu.audit_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
+ </if>
<if test="user.jurisdiction!=null and user.jurisdiction!='' and user.jurisdiction!='1372091709474910209'">
and (j.id = #{user.jurisdiction} or j.parent_id = #{user.jurisdiction})
</if>
@@ -189,7 +195,7 @@
and bu.securitynumber = #{user.securitynumber}
</if>
<if test="user.score!=null and user.score != ''">
- and p.score = 3
+ and p.score = 3
</if>
ORDER BY bu.id
</select>
@@ -225,28 +231,25 @@
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
+ 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.cardid!=null and user.cardid != ''">
@@ -345,15 +348,15 @@
<select id="getNotAuditAllUserList" resultType="org.springblade.modules.system.entity.User">
select id, cardid
from blade_user
- where 1=1
- and (examination_type is null or examination_type="" or examination_type=null)
+ where 1 = 1
+ and (examination_type is null or examination_type = "" or examination_type = null)
</select>
<!--根据保安员编码查询保安信息-->
<select id="getUserInfoBySecurityNumber" resultType="org.springblade.modules.system.vo.UserVO">
select bu.*,
ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING(cardid, 7, 4), 0) age,
- bd.dept_name deptName
+ bd.dept_name deptName
from blade_user bu
left join
blade_dept bd
@@ -471,4 +474,63 @@
order by bu.examination_mx ${user.sort}
</if>
</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