You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
2.3 KiB
51 lines
2.3 KiB
2 years ago
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
<!DOCTYPE mapper
|
||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
<mapper namespace="com.ruoyi.screen.mapper.ZongzhiScreenSaftyMapper">
|
||
|
|
||
|
|
||
|
<select id="getSource" resultType="com.ruoyi.screen.domain.response.ZongzhiSourceResponse">
|
||
|
select count(*) as count ,type
|
||
|
from tc_data_source
|
||
|
GROUP BY type
|
||
|
</select>
|
||
|
<select id="getsafety" resultType="com.ruoyi.screen.domain.response.ZongzhiSafetyResponse">
|
||
|
select count(*) as count ,attack_type AS attackType
|
||
|
from tc_safety_detection
|
||
|
GROUP BY attack_type
|
||
|
</select>
|
||
|
<select id="getSafetyList" resultType="com.ruoyi.screen.domain.response.ZongzhiSafetyListResponse">
|
||
|
select source_ip, attack_time AS attackTime , attack_type as attackType
|
||
|
from tc_safety_detection
|
||
|
</select>
|
||
|
<select id="getsupervise" resultType="com.ruoyi.screen.domain.response.ZongzhiSuperviseResponse">
|
||
|
select a.count,
|
||
|
a.name,
|
||
|
b.count1,
|
||
|
b.name1,
|
||
|
c.count2,
|
||
|
c.name2,
|
||
|
d.count3,
|
||
|
d.name3
|
||
|
from (select count(*) as count,'等保系统' as name from tc_dengbao_system) a,
|
||
|
(select count(*) as count1, '等保单位' as name1 from tc_dengbao_unit) b,
|
||
|
(select count(*) as count2, '政府网站' as name2 from tc_government_web) c,
|
||
|
(select count(*) as count3, 'IDC单位' as name3 from tc_idc_unit) d
|
||
|
|
||
|
</select>
|
||
|
<select id="getAttack" resultType="com.ruoyi.screen.domain.response.ZongzhiAttackResponse">
|
||
|
SELECT COUNT(*) AS count, attack_ip_region as attackIpRegion
|
||
|
FROM tc_safety_detection
|
||
|
GROUP BY attack_ip_region;
|
||
|
</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
|
||
|
from tc_safety_detection
|
||
|
GROUP BY attacked_ip
|
||
|
ORDER BY count desc limit 5
|
||
|
</select>
|
||
|
<select id="getSafetyHazard" resultType="com.ruoyi.screen.domain.response.ZongzhiSafetyHazardResponse">
|
||
|
select type,count(*) as count from tc_safety_danger GROUP BY type
|
||
|
</select>
|
||
|
</mapper>
|