diff --git a/dk-common/common-bus/pom.xml b/dk-common/common-bus/pom.xml
index c0cfdf8..5d12802 100644
--- a/dk-common/common-bus/pom.xml
+++ b/dk-common/common-bus/pom.xml
@@ -34,7 +34,7 @@
org.springframework.cloudspring-cloud-bus
- 4.1.2
+ ${spring.cloud.bus.version}
diff --git a/dk-modules/business/src/main/resources/mapper/business/BusinessAlertMapper.xml b/dk-modules/business/src/main/resources/mapper/business/BusinessAlertMapper.xml
index b73248b..b32d8c9 100644
--- a/dk-modules/business/src/main/resources/mapper/business/BusinessAlertMapper.xml
+++ b/dk-modules/business/src/main/resources/mapper/business/BusinessAlertMapper.xml
@@ -494,7 +494,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dept_name AS root_dept_name,
dept_id,
dept_name
- FROM dk_cloud.sys_dept
+ FROM
+ dk_cloud.sys_dept
WHERE dept_id IN
#{deptId}
@@ -505,31 +506,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dt.root_dept_name,
d.dept_id,
d.dept_name
- FROM dk_cloud.sys_dept d
- JOIN warning_summary dt
- ON d.parent_id = dt.dept_id
- WHERE d.del_flag = '0'
+ FROM
+ dk_cloud.sys_dept d
+ JOIN warning_summary dt ON d.parent_id = dt.dept_id
+ WHERE
+ d.del_flag = '0'
)
SELECT
- root_dept_name deptName,
- total
- FROM (
- SELECT
- dt.root_dept_id,
- dt.root_dept_name,
- COUNT(ba.id) total
- FROM business_alert ba
- JOIN warning_summary dt
- ON ba.dept_id = dt.dept_id
- WHERE
- 1=1
+ ws.root_dept_name AS deptName,
+ IFNULL(COUNT(ba.id), 0) AS total
+ FROM
+ warning_summary ws
+ LEFT JOIN business_alert ba ON ws.dept_id = ba.dept_id
and = #{startTime} ]]>
and
- GROUP BY dt.root_dept_id,dt.root_dept_name
- ) dept_stats
- ORDER BY total DESC
- LIMIT 5;
+ GROUP BY
+ ws.root_dept_id,
+ ws.root_dept_name
+ ORDER BY
+ CASE WHEN total IS NULL THEN 1 ELSE 0 END,
+ total DESC
+ LIMIT 5