2 Комити 3f782a147d ... f1546ee875

Аутор SHA1 Порука Датум
  zhangpeng f1546ee875 增加一个区域字段 整段测试通过替换掉了 пре 1 година
  zhangpeng cf1fe50751 替换掉最新的应用告警趋势 пре 1 година
2 измењених фајлова са 20 додато и 11 уклоњено
  1. 18 9
      all.sql
  2. 2 2
      fayuan_zp

+ 18 - 9
all.sql

@@ -948,7 +948,7 @@ truncate table bi_sijifayuan_alm_group_by_time;
 	left join bi_pub_organ_siji b
 	on a.alarm_object_id = b.CODE) m
 	group by 
-		date_format(occur_time,'%Y%m%d%H') ,
+		date_format(occur_time,'%Y%m%d%H') ,0
 		date_format(occur_time,'%H') ,
 		alarm_object_id,
 		alarm_object_ip,
@@ -1880,6 +1880,7 @@ DROP TABLE IF EXISTS `bi_panoramic_view_net_attack_trend`;
 CREATE TABLE `bi_panoramic_view_net_attack_trend` (
   `dtype` varchar(10) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '日期类型',
   `thedvalue` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '日期',
+	`organ_name` varchar(200) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '区域',
   `score_name` varchar(50) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '指标名称',
   `the_score` double DEFAULT NULL COMMENT '指标值'
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1889,6 +1890,7 @@ CREATE TABLE `bi_panoramic_view_net_attack_trend` (
 	select 
 		'DAY' as dtype,
 		thedvalue,
+		0 as organ_name,
 		case b.mm when 1 then '网络攻击尝试数' when 2 then '网络攻击成功数' when 3 then '网络攻击结果不明数' when 4 then '恶意程序数' else '' end as score_name,
 		case b.mm when 1 then network_attack_try_count when 2 then network_attack_success_count when 3 then network_attack_unknown_count when 4 then server_vul_total_count else 0.0 end as the_score
 	from 
@@ -1907,18 +1909,20 @@ CREATE TABLE `bi_panoramic_view_net_attack_trend` (
 	union all select 4) b;
 	
 	insert into bi_panoramic_view_net_attack_trend
-	select 'MONTH' as dtype,substring(thedvalue,1,6) AS thedvalue,
+	select 'MONTH' as dtype,substring(thedvalue,1,6) AS thedvalue,organ_name,
 				 score_name,avg(the_score) as the_score
 	from bi_panoramic_view_net_attack_trend 
 	where dtype = 'DAY'
-	GROUP BY substring(thedvalue,1,6),score_name;
+	GROUP BY substring(thedvalue,1,6),score_name,organ_name;
 	
 	insert into bi_panoramic_view_net_attack_trend
-	select 'YEAR' as dtype,substring(thedvalue,1,4) AS thedvalue,
+	select 'YEAR' as dtype,substring(thedvalue,1,4) AS thedvalue,organ_name,
 				 score_name,avg(the_score) as the_score
 	from bi_panoramic_view_net_attack_trend 
 	where dtype = 'MONTH'
-	GROUP BY substring(thedvalue,1,4),score_name;
+	GROUP BY substring(thedvalue,1,4),score_name,organ_name;
+
+
 
 	-- (22)设备漏洞变化趋势
 -- 建表语句
@@ -1928,6 +1932,7 @@ DROP TABLE IF EXISTS `bi_panoramic_view_sb_ld_trend`;
 CREATE TABLE `bi_panoramic_view_sb_ld_trend` (
   `dtype` varchar(10) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '日期类型',
   `thedvalue` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '日期',
+	`organ_name`varchar(200) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '区域',
   `app_name` varchar(50) NOT NULL DEFAULT '0' COMMENT '设备名称暂时没有数据',
   `score_name` varchar(50) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
   `the_score` double DEFAULT NULL
@@ -1939,6 +1944,7 @@ CREATE TABLE `bi_panoramic_view_sb_ld_trend` (
 	select 
 		'DAY' as dtype,
 		thedvalue,
+		0  as organ_name,
 		'' as app_name,
 		case b.mm when 1 then '安全设备漏洞' when 2 then '网络设备漏洞' when 3 then '终端PC漏洞' when 4 then '服务器漏洞' else '' end as score_name,
 		case b.mm when 1 then security_device_vul_total_count when 2 then network_device_vul_total_count when 3 then terminal_vul_total_count when 4 then server_vul_total_count else 0.0 end as the_score
@@ -1958,18 +1964,21 @@ CREATE TABLE `bi_panoramic_view_sb_ld_trend` (
 	union all select 4) b;
 	
 	insert into bi_panoramic_view_sb_ld_trend
-	select 'MONTH' as dtype,substring(thedvalue,1,6) AS thedvalue,
+	select 'MONTH' as dtype,substring(thedvalue,1,6) AS thedvalue,,organ_name
 				 '' as app_name,score_name,avg(the_score) as the_score
 	from bi_panoramic_view_sb_ld_trend 
 	where dtype = 'DAY'
-	GROUP BY substring(thedvalue,1,6),score_name;
+	GROUP BY substring(thedvalue,1,6),score_name,organ_name;
 	
 	insert into bi_panoramic_view_sb_ld_trend
-	select 'YEAR' as dtype,substring(thedvalue,1,4) AS thedvalue,
+	select 'YEAR' as dtype,substring(thedvalue,1,4) AS thedvalue,organ_name,
 				 '' as app_name,score_name,avg(the_score) as the_score
 	from bi_panoramic_view_sb_ld_trend 
 	where dtype = 'MONTH'
-	GROUP BY substring(thedvalue,1,4),score_name;
+	GROUP BY substring(thedvalue,1,4),score_name,organ_name;
+	
+	
+
 
 	-- (23)设备准入变化趋势、双因子认证变化趋势、纳入4A变化趋势
 

+ 2 - 2
fayuan_zp

@@ -1291,7 +1291,7 @@ t2.ITM_APPCATAGORY_NAME,t1.ORGAN_ID,t3.SHORT_NAME,t1.PRIORITY,t1.app_type,t1.ITM
 insert into bi_app_access_stat
 SELECT
 	'DAY' AS dtype,
-  substring(thedvalue,1,8) AS thedvalue, 
+  substring(thedvalue,1,8) AS thedvalue, 							
 	NET_NAME,
 	organ_name,
 	PRIORITY,
@@ -1852,7 +1852,7 @@ from
 	bi_cunchu_shebei_yunwei_fenxi where dtype = 'MONTH'
  group by itm_hardware_resources_id,substring(thedvalue,1,4);
  
- select * from bi_cunchu_shebei_yunwei_fenxi
+