|
|
|
@ -26,7 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getUnAttackTop" resultType="com.ruoyi.screen.domain.response.ZongzhiUnAttackResponse">
|
|
|
|
|
select attacked_ip as attackedIp, attacked_ip_region as attackIpRegion, count(*)as count, ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 1) AS pt
|
|
|
|
|
select attacked_ip as attackedIp, attacked_ip_region as attackIpRegion, count(*)as count, ROUND(COUNT(*) * 100.0
|
|
|
|
|
/ SUM(COUNT(*)) OVER (), 1) AS pt
|
|
|
|
|
from tc_safety_detection
|
|
|
|
|
GROUP BY attacked_ip
|
|
|
|
|
ORDER BY count desc limit 5
|
|
|
|
@ -57,9 +58,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
from tc_idc_unit
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getTbArea" resultType="com.ruoyi.screen.domain.response.ZongzhiTbAreaResponse">
|
|
|
|
|
SELECT ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 1) AS pt, count(*) as count,area_id as areaId
|
|
|
|
|
from tc_tb where tb_type='1'
|
|
|
|
|
group by area_id
|
|
|
|
|
SELECT
|
|
|
|
|
s.area_id AS areaId,
|
|
|
|
|
ROUND( COUNT( * ) * 100.0 / SUM( COUNT( * ) ) OVER ( ), 1 ) AS pt,
|
|
|
|
|
count( * ) AS count
|
|
|
|
|
FROM
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
CASE
|
|
|
|
|
WHEN
|
|
|
|
|
LOCATE( ',', area_id ) = 0 THEN
|
|
|
|
|
TRIM( TRAILING ']' FROM SUBSTR( area_id, LOCATE( '[', area_id ) + 1 ) ) ELSE TRIM( TRAILING ']' FROM
|
|
|
|
|
SUBSTRING_INDEX( area_id, ',', - 1 ) )
|
|
|
|
|
END AS area_id
|
|
|
|
|
FROM
|
|
|
|
|
tc_tb
|
|
|
|
|
WHERE
|
|
|
|
|
tb_type = '1'
|
|
|
|
|
AND area_id IS NOT NULL
|
|
|
|
|
) s
|
|
|
|
|
GROUP BY
|
|
|
|
|
s.area_id
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getTbDept" resultType="com.ruoyi.screen.domain.response.ZongzhiTbDeptResponse">
|
|
|
|
|
SELECT COUNT(*) AS count, dep_name
|
|
|
|
@ -88,12 +107,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
SELECT COUNT(*) AS count,
|
|
|
|
|
count(case when state=1 then state else null end) as complete,
|
|
|
|
|
count(case when state=1 then state else null end) / COUNT(*) AS pt
|
|
|
|
|
FROM `tc_tb` WHERE DATE(tb_time) >= DATE_SUB(CURRENT_DATE(), INTERVAL 6 MONTH) and tb_time <= CURRENT_DATE();;
|
|
|
|
|
FROM `tc_tb` WHERE DATE(tb_time) >= DATE_SUB(CURRENT_DATE(), INTERVAL 6 MONTH) and tb_time <=
|
|
|
|
|
CURRENT_DATE();;
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getyearList"
|
|
|
|
|
resultType="com.ruoyi.screen.domain.response.ZongzhiTbDeptCompleteSixResponse">
|
|
|
|
|
SELECT COUNT(*) AS count,
|
|
|
|
|