From df577d901e09267d2e2ef597d063e3d6f3454bff Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 25 Aug 2021 18:00:05 +0800
Subject: [PATCH] 用户审查接口修改
---
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml | 155 +++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 130 insertions(+), 25 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 9c88228..f0402b2 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.springblade.modules.information.mapper.InformationMapper">
<!-- 通用查询映射结果 -->
- <resultMap id="informationResultMap" type="org.springblade.modules.information.entity.Information">
+ <resultMap id="informationResultMap" type="org.springblade.modules.information.vo.InformationVO">
<id column="id" property="id"/>
<result column="creditCode" property="creditcode"/>
<result column="enterpriseName" property="enterprisename"/>
@@ -28,22 +28,40 @@
<result column="contactscell" property="contactscell"/>
<result column="businessLicense" property="businessLicense"/>
<result column="licence" property="licence"/>
+ <result column="znum" property="znum"/>
+ <result column="cnum" property="cnum"/>
+ <result column="pnum" property="pnum"/>
+ <result column="fregion" property="fregion"/>
+ <result column="ftime" property="ftime"/>
</resultMap>
<select id="selectInformationPage" resultMap="informationResultMap">
- select * from sys_information where 1=1
+ SELECT
+ i.*,
+ IFNULL(A.znum ,0) as znum,
+ IFNULL(B.cnum ,0) as cnum,
+ IFNULL(C.pnum ,0) as pnum
+ FROM
+ sys_information i
+ LEFT JOIN ( SELECT COUNT( * ) AS znum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND status=1 GROUP BY dept_id ) A ON A.dept_id = i.departmentid
+ LEFT JOIN ( SELECT COUNT( * ) AS cnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND status=1 AND hold=1 GROUP BY dept_id ) B ON B.dept_id = i.departmentid
+ LEFT JOIN ( SELECT COUNT( * ) AS pnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND status=1 AND dispatch=0 GROUP BY dept_id ) C ON C.dept_id = i.departmentid
+ where 1=1
<if test="information.enterprisename!=null and information.enterprisename!=''">
- and enterpriseName like concat(concat('%', #{information.enterprisename}),'%')
+ and i.enterpriseName like concat(concat('%', #{information.enterprisename}),'%')
</if>
<if test="information.representative!=null and information.representative!=''">
- and representative like concat(concat('%', #{information.representative}),'%')
+ and i.representative like concat(concat('%', #{information.representative}),'%')
</if>
<if test="information.stats!=null and information.stats!=''">
- and stats=#{stats}
+ and i.stats=#{information.stats}
</if>
- <if test="information.jurisdiction!=null and information.jurisdiction!=''">
- and jurisdiction=#{jurisdiction}
+ <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1123598813738675201'">
+ and i.jurisdiction=#{information.jurisdiction}
+ </if>
+ <if test="information.departmentid!=null and information.departmentid!=''">
+ and i.departmentid=#{information.departmentid}
</if>
</select>
@@ -446,7 +464,7 @@
FROM
blade_user
WHERE
- role_id = '1412226235153731586'
+ role_id = '1412226235153731586' and status=1
AND DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
GROUP BY
dept_id,
@@ -460,7 +478,7 @@
FROM
blade_user
WHERE
- role_id = '1412226235153731586'
+ role_id = '1412226235153731586' and status=1
AND PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( create_time, '%Y%m' ) ) = 1
GROUP BY
dept_id,
@@ -863,7 +881,7 @@
FROM blade_user u
LEFT JOIN blade_dept d ON d.id = u.dept_id
LEFT JOIN sys_jurisdiction j ON j.id = u.jurisdiction
- WHERE u.examination_type = 1 and u.is_deleted=0
+ WHERE u.examination_type = 1 and u.is_deleted=0 and u.status = 1
<if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1123598813738675201'">
and u.jurisdiction =#{jurisdiction}
</if>
@@ -977,7 +995,7 @@
d.dept_name AS deptname,
j.dept_name AS jurname
FROM
- ( SELECT COUNT( * ) AS num, dept_id, jurisdiction FROM blade_user WHERE role_id = '1412226235153731586' GROUP BY
+ ( SELECT COUNT( * ) AS num, dept_id, jurisdiction FROM blade_user WHERE role_id = '1412226235153731586' and status=1 GROUP BY
dept_id, jurisdiction ) A
LEFT JOIN (
SELECT
@@ -987,7 +1005,7 @@
FROM
blade_user
WHERE
- role_id = '1412226235153731586'
+ role_id = '1412226235153731586' and status=1
AND hold=1
GROUP BY
dept_id,
@@ -1001,7 +1019,7 @@
FROM
blade_user
WHERE
- role_id = '1412226235153731586'
+ role_id = '1412226235153731586' and status=1
AND dispatch=0
GROUP BY
dept_id,
@@ -1015,7 +1033,7 @@
FROM
blade_user
WHERE
- role_id = '1412226235153731586'
+ role_id = '1412226235153731586' and status=1
AND dispatch=1
GROUP BY
dept_id,
@@ -1032,7 +1050,7 @@
FROM
blade_user
WHERE
- role_id = '1412226235153731586'
+ role_id = '1412226235153731586' and status=1
AND photo=1
GROUP BY
dept_id,
@@ -1046,7 +1064,7 @@
FROM
blade_user
WHERE
- role_id = '1412226235153731586'
+ role_id = '1412226235153731586' and status=1
AND examination_mx=1
GROUP BY
dept_id,
@@ -1059,7 +1077,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>
@@ -1119,14 +1137,14 @@
) A
LEFT JOIN (SELECT COUNT(*) AS znum, dept_id, jurisdiction
FROM blade_user
- WHERE role_id = '1412226235153731586'
+ WHERE role_id = '1412226235153731586' and status=1
GROUP BY dept_id, jurisdiction) B ON A.departmentid = B.dept_id
LEFT JOIN (
SELECT COUNT(*) AS zcnum,
dept_id,
jurisdiction
FROM blade_user
- WHERE role_id = '1412226235153731586'
+ WHERE role_id = '1412226235153731586' and status=1
AND examination_type = 0
GROUP BY dept_id,
jurisdiction
@@ -1136,7 +1154,7 @@
dept_id,
jurisdiction
FROM blade_user
- WHERE role_id = '1412226235153731586'
+ WHERE role_id = '1412226235153731586' and status=1
AND hold = 1
GROUP BY dept_id,
jurisdiction
@@ -1200,14 +1218,14 @@
dept_id,
jurisdiction
FROM blade_user
- WHERE role_id = '1412226235153731586'
+ WHERE role_id = '1412226235153731586' and status=1
AND dispatch = 0
GROUP BY dept_id,
jurisdiction
) D ON A.departmentid = D.dept_id
LEFT JOIN (SELECT COUNT(*) AS znum, dept_id, jurisdiction
FROM blade_user
- WHERE role_id = '1412226235153731586'
+ WHERE role_id = '1412226235153731586' and status=1
GROUP BY dept_id, jurisdiction) E ON A.departmentid = E.dept_id) J
WHERE 1=1
<if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'">
@@ -1224,6 +1242,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
@@ -1242,14 +1262,14 @@
) A
LEFT JOIN ( SELECT COUNT( * ) AS num, dept_id FROM sys_dispatcher_unit GROUP BY dept_id ) B ON A.departmentid =
B.dept_id
- LEFT JOIN ( SELECT COUNT( * ) AS znum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' GROUP BY
+ LEFT JOIN ( SELECT COUNT( * ) AS znum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' and status=1 GROUP BY
dept_id ) C ON A.departmentid = C.dept_id
where 1=1
<if test="jurisdiction!=null and jurisdiction!=''and jurisdiction!='1123598813738675201'">
AND A.jurisdiction=#{jurisdiction}
</if>
<if test="deptid!=null and deptid!=''">
- and A.departmentid=#{deptid}
+ and A.enterpriseName like concat('%', #{deptid},'%')
</if>
</select>
@@ -1296,7 +1316,7 @@
and di.jurisdiction =#{jurisdiction}
</if>
<if test="fid!=null and fid!=''">
- and di.dispatcher_unit_id=#{fid}
+ and u.name like concat('%', #{fid},'%')
</if>
</select>
<!--服务单位下拉-->
@@ -1335,4 +1355,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