From f24c180ae9afa33ddef6ff1aa73baa35df73f2ca Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 24 Aug 2021 11:14:12 +0800
Subject: [PATCH] 用户新增发证时间字段
---
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml | 100 ++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 92 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 fe78355..33a0ddf 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -1059,7 +1059,7 @@
and A.jurisdiction =#{jurisdiction}
</if>
<if test="deptid!=null and deptid!=''">
- and A.dept_id =#{deptid}
+ and d.dept_name like concat(concat('%', #{deptid}),'%')
</if>
</select>
@@ -1163,8 +1163,7 @@
and J.enterpriseName like concat('%', #{enterpriseName},'%')
</if>
GROUP BY J.enterpriseName,
- J.departmentid, J.cznum, J.ghnum, J.ghnum, J.pcnum, J.sbnum, J.zcnum, J.znum, J.jurname,J.jurisdiction limit
- #{current},#{size};
+ J.departmentid, J.cznum, J.ghnum, J.ghnum, J.pcnum, J.sbnum, J.zcnum, J.znum, J.jurname,J.jurisdiction
</select>
<!--公司经济情况进入图表-->
@@ -1218,7 +1217,6 @@
and J.enterpriseName like concat('%', #{enterpriseName},'%')
</if>
GROUP BY J.departmentid, J.enterpriseName, J.jurisdiction, J.jurname, J.pcnum, J.sbcount, J.sbnum, J.zb, J.znum
- limit #{current},#{size};
</select>
@@ -1226,6 +1224,8 @@
<select id="selectYw" resultType="java.util.HashMap">
SELECT
A.enterpriseName,
+ A.departmentid,
+ A.jurisdiction,
A.dept_name as jurname,
IFNULL( B.num, 0 ) AS fwnum,
IFNULL( C.znum, 0 ) AS znum
@@ -1234,6 +1234,7 @@
SELECT
i.enterpriseName,
i.departmentid,
+ i.jurisdiction,
j.dept_name
FROM
sys_information i
@@ -1250,9 +1251,8 @@
AND A.jurisdiction=#{jurisdiction}
</if>
<if test="deptid!=null and deptid!=''">
- and A.departmentid=#{deptid}
+ and A.dept_name like concat('%', #{deptid},'%')
</if>
- limit #{current},#{size};
</select>
<!--保安人员详情-->
@@ -1298,9 +1298,8 @@
and di.jurisdiction =#{jurisdiction}
</if>
<if test="fid!=null and fid!=''">
- and di.dispatcher_unit_id=#{fid}
+ and u.name like concat('%', #{fid},'%')
</if>
- limit #{current},#{size};
</select>
<!--服务单位下拉-->
<select id="selectFw" resultType="java.util.HashMap">
@@ -1338,4 +1337,89 @@
GROUP BY
i.enterpriseName,j.dept_name
</select>
+
+ <!--违规经营-->
+ <select id="selectWg" resultType="java.util.HashMap">
+ SELECT A.*,
+ A.deptname,
+ A.jurname,
+ IFNULL(B.cznum, 0) AS cznum,
+ IFNULL(C.sbnum, 0) AS sbnum,
+ IFNULL(D.znum, 0) AS znum
+ FROM (
+ SELECT u.*,
+ d.dept_name AS deptname,
+ j.dept_name AS jurname
+ FROM sys_information u
+ LEFT JOIN blade_dept d ON d.id = u.departmentid
+ LEFT JOIN sys_jurisdiction j ON j.id = u.jurisdiction
+ ) A
+ LEFT JOIN (
+ SELECT COUNT(*) AS cznum,
+ dept_id
+ FROM blade_user
+ WHERE hold = 1
+ AND role_id = '1412226235153731586'
+ AND is_deleted = 0
+ GROUP BY dept_id
+ ) B ON B.dept_id = A.departmentid
+ LEFT JOIN (
+ SELECT COUNT(*) AS sbnum,
+ dept_id
+ FROM blade_user
+ WHERE soil = 0
+ AND role_id = '1412226235153731586'
+ AND is_deleted = 0
+ GROUP BY dept_id
+ ) C ON C.dept_id = A.departmentid
+ LEFT JOIN (SELECT COUNT(*) AS znum, dept_id
+ FROM blade_user
+ WHERE role_id = '1412226235153731586'
+ AND is_deleted = 0
+ GROUP BY dept_id) D ON D.dept_id = A.departmentid where 1=1
+ <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1123598813738675201'">
+ and A.jurisdiction = #{jurisdiction}
+ </if>
+ </select>
+
+
+ <!--经营不善-->
+ <select id="selectJy" resultType="java.util.HashMap">
+ SELECT i.*,
+ IFNULL(d.num, 0) as num
+ FROM sys_information i
+ LEFT JOIN (SELECT COUNT(*) num, dept_id FROM sys_dispatcher_unit GROUP BY dept_id) d
+ ON i.departmentid = d.dept_id where 1=1
+ <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1123598813738675201'">
+ and i.jurisdiction = #{jurisdiction}
+ </if>
+ </select>
+
+ <!--有实无名-->
+ <select id="selectYs" resultType="java.util.HashMap">
+ SELECT i.*,
+ IFNULL(d.num, 0) as num
+ FROM sys_information i
+ LEFT JOIN (SELECT COUNT(*) num, dept_id FROM blade_user WHERE role_id='1412226235153731586' GROUP BY dept_id) d
+ ON i.departmentid = d.dept_id where 1=1
+ <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1123598813738675201'">
+ and i.jurisdiction = #{jurisdiction}
+ </if>
+ </select>
+
+
+ <select id="selectAge" resultType="java.util.HashMap">
+ SELECT
+ IFNULL(TIMESTAMPDIFF( YEAR, bu.birthday, CURDATE( ) ),0) AS age
+ FROM
+ blade_user bu
+ LEFT JOIN sys_information si ON si.departmentid = bu.dept_id
+ WHERE bu.`status`=1 AND bu.role_id='1412226235153731586'
+ <if test="jurisdiction!=null and jurisdiction != '' and jurisdiction != '1123598813738675201'">
+ and bu.jurisdiction = #{jurisdiction}
+ </if>
+ <if test="deptid!=null and deptid != ''">
+ and bu.dept_id = #{deptid}
+ </if>
+ </select>
</mapper>
--
Gitblit v1.9.3