From f63fff71fcd7a62ad73b0b9eda614f3b1fa3badf Mon Sep 17 00:00:00 2001
From: 钟日健 <5689795+arsn@user.noreply.gitee.com>
Date: Fri, 22 Oct 2021 22:51:09 +0800
Subject: [PATCH] 考试成绩修改状态重置
---
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml | 164 ++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 120 insertions(+), 44 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 dbeebc2..cb3b390 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -61,15 +61,46 @@
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' OR role_id = '1416733602219110402' ) 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' OR role_id = '1416733602219110402' ) 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
+ LEFT JOIN
+ (
+ SELECT COUNT( * ) AS znum, dept_id FROM blade_user
+ WHERE 1=1
+ and role_id = '1412226235153731586'
+ and is_deleted = 0
+ 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 1=1
+ and role_id = '1412226235153731586'
+ and is_deleted = 0
+ 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 1=1
+ and is_deleted = 0
+ and role_id = '1412226235153731586'
+ AND status=1
+ AND dispatch=0
+ GROUP BY dept_id
+ ) C
+ ON C.dept_id = i.departmentid
+ left join
+ sys_jurisdiction sj
+ on
+ sj.id = i.jurisdiction
where 1=1
+ <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'">
+ and (sj.id=#{information.jurisdiction} or sj.parent_id=#{information.jurisdiction})
+ </if>
<if test="information.enterprisename!=null and information.enterprisename!=''">
and i.enterpriseName like concat(concat('%', #{information.enterprisename}),'%')
</if>
@@ -78,9 +109,6 @@
</if>
<if test="information.stats!=null and information.stats!=''">
and i.stats=#{information.stats}
- </if>
- <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'">
- and i.jurisdiction=#{information.jurisdiction}
</if>
<if test="information.departmentid!=null and information.departmentid!=''">
and i.departmentid=#{information.departmentid}
@@ -149,16 +177,26 @@
IFNULL( B.num, 0 ) AS bzc
FROM
(
- SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H
- LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE u.examination_type = 0 and role_id =
+ SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction
+ ) H
+ LEFT JOIN
+ ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE (u.examination_type = 0 or
+ u.examination_type is null) and role_id =
'1412226235153731586' AND `status` = 1 AND is_deleted = 0 GROUP BY u.dept_id
- ) A ON H.departmentid = A.dept_id
- LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE (u.examination_type = 1 or
- u.examination_type is null ) and role_id = '1412226235153731586' AND `status` = 1 AND is_deleted = 0 GROUP BY
+ ) A
+ ON H.departmentid = A.dept_id
+ LEFT JOIN
+ ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE u.examination_type = 1 and role_id = '1412226235153731586' AND `status` = 1 AND is_deleted = 0 GROUP BY
u.dept_id
- ) B ON H.departmentid = B.dept_id where 1=1
+ ) B
+ ON H.departmentid = B.dept_id
+ left join
+ sys_jurisdiction sj
+ on
+ sj.id = H.jurisdiction
+ where 1=1
<if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
- and H.jurisdiction = #{jurisdiction}
+ and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction})
</if>
<if test="deptid!=null and deptid!=''">
and H.departmentid = #{deptid}
@@ -175,7 +213,8 @@
(
SELECT departmentid,jurisdiction FROM sys_information GROUP BY departmentid,jurisdiction
) H
- LEFT JOIN(
+ LEFT JOIN
+ (
SELECT
COUNT( * ) AS thisnum,
dept_id
@@ -188,8 +227,10 @@
AND hold = 1
GROUP BY
dept_id
- ) A ON A.dept_id=H.departmentid
- LEFT JOIN (
+ ) A
+ ON A.dept_id=H.departmentid
+ LEFT JOIN
+ (
SELECT
COUNT(*) AS lastnum,
dept_id
@@ -202,13 +243,18 @@
AND hold = 2
GROUP BY
dept_id
- ) B ON B.dept_id=H.departmentid
+ ) B
+ ON B.dept_id=H.departmentid
+ left join
+ sys_jurisdiction sj
+ on
+ sj.id = H.jurisdiction
where 1=1
+ <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 H.departmentid = #{deptid}
- </if>
- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
- and H.jurisdiction = #{jurisdiction}
</if>
</select>
<!--派遣服务单位统计-->
@@ -240,7 +286,8 @@
AND dispatch = 0
GROUP BY
dept_id
- ) A ON A.dept_id = H.departmentid
+ ) A
+ ON A.dept_id = H.departmentid
LEFT JOIN (
SELECT
COUNT( * ) AS lastnum,
@@ -254,9 +301,15 @@
AND dispatch = 1
GROUP BY
dept_id
- ) B ON H.departmentid = B.dept_id where 1=1
+ ) B
+ ON H.departmentid = B.dept_id
+ left join
+ sys_jurisdiction sj
+ on
+ sj.id = H.jurisdiction
+ where 1=1
<if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
- and H.jurisdiction = #{jurisdiction}
+ and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction})
</if>
<if test="deptid!=null and deptid!=''">
and H.departmentid = #{deptid}
@@ -266,20 +319,38 @@
<select id="selectSoil" resultType="java.util.HashMap">
SELECT IFNULL(A.numj, 0) as numj,
IFNULL(B.numwj, 0) as numz
- FROM (SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction) H
- LEFT JOIN (SELECT COUNT(*) AS numj, dept_id
+ FROM
+ (
+ SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction
+ ) H
+ LEFT JOIN
+ (
+ SELECT COUNT(*) AS numj, dept_id
FROM blade_user
WHERE soil = 0 AND `status` = 1 AND is_deleted = 0 AND role_id = '1412226235153731586'
- GROUP BY dept_id) A ON A.dept_id = H.departmentid
- LEFT JOIN (SELECT COUNT(*) AS numwj, dept_id FROM blade_user WHERE soil = 1 and `status` = 1 AND is_deleted = 0
- AND role_id = '1412226235153731586' GROUP BY
- dept_id) B
- ON H.departmentid = B.dept_id where 1=1
+ GROUP BY dept_id
+ ) A
+ ON A.dept_id = H.departmentid
+ LEFT JOIN
+ (
+ SELECT COUNT(*) AS numwj, dept_id FROM blade_user
+ WHERE soil = 1
+ and `status` = 1
+ AND is_deleted = 0
+ AND role_id = '1412226235153731586'
+ GROUP BY dept_id
+ ) B
+ ON H.departmentid = B.dept_id
+ left join
+ sys_jurisdiction sj
+ on
+ sj.id = H.jurisdiction
+ where 1=1
+ <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 H.departmentid = #{deptid}
- </if>
- <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
- and H.jurisdiction = #{jurisdiction}
</if>
</select>
@@ -312,16 +383,21 @@
<!--查询本年所有月份h合同开始时间的客户数量-->
<select id="queryYearKh" resultType="java.util.HashMap">
SELECT
- start_time,
- end_time
+ sdu.start_time,
+ sdu.end_time
FROM
- `sys_dispatcher_unit`
- WHERE YEAR (end_time) >='2021'
+ sys_dispatcher_unit sdu
+ left join
+ sys_jurisdiction sj
+ on
+ sj.id = sdu.jurisdiction
+ where 1=1
+ and YEAR (end_time) >= #{year}
<if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
- and jurisdiction =#{jurisdiction}
+ and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction})
</if>
<if test="deptid!=null and deptid!=''">
- and dept_id =#{deptid}
+ and sdu.dept_id =#{deptid}
</if>
</select>
</mapper>
--
Gitblit v1.9.3