Forráskód Böngészése

Merge commit 'e095a1138b2cc2cde33a8017a6884ccc2c07408c' into peng

zhangpeng 1 éve
szülő
commit
dd148f4515
1 módosított fájl, 15 hozzáadás és 11 törlés
  1. 15 11
      all.sql

+ 15 - 11
all.sql

@@ -1247,7 +1247,7 @@ TRUNCATE table bi_recycle_trend;
 	-- (8)应用系统监控覆盖率趋势
 	
 -- 建表语句
-DROP TABLE bi_app_fugai;
+DROP TABLE IF EXISTS bi_app_fugai;
 CREATE TABLE `bi_app_fugai` (
 	`dtype` varchar(5) NOT NULL DEFAULT '' COMMENT '日期类型',
 	`thedvalue` varchar(15) DEFAULT NULL COMMENT '日期',
@@ -1313,7 +1313,8 @@ CREATE TABLE `bi_app_fugai` (
 	`cloud_flag` varchar(20) DEFAULT NULL COMMENT '应用对应资源是否上云1为上云,0为不上云',
 	`organ_name` varchar(200) DEFAULT NULL COMMENT '区域',
 	`itm_hardware_resources_areacode` varchar(100) DEFAULT NULL COMMENT '设备区域',
-	`on_line` varchar(255) DEFAULT NULL
+	`on_line` varchar(255) DEFAULT NULL,
+  	`cloud` varchar(255) DEFAULT NULL COMMENT '云平台'
 ) ENGINE = InnoDB DEFAULT CHARSET = utf8;
 	
 	TRUNCATE table bi_app_fugai;
@@ -1331,7 +1332,8 @@ d.net_name as net_name,
 e.cloud_flag as cloud_flag,
 f.`SHORT_NAME` as organ_name,
 e.itm_hardware_resources_areacode as itm_hardware_resources_areacode,
-b.on_line as on_line
+b.on_line as on_line,
+e.cloud
 from (
 select distinct date_format(dt_d,'%Y%m%d') as thedvalue from bi_m_date where dt_d >= '2021-01-01' and dt_d < '2023-11-09') a
 left join itm_app b
@@ -1339,8 +1341,8 @@ on a.thedvalue >= date_format(b.create_time,'%Y%m%d')
 LEFT JOIN m_com_dict c on b.app_type=c.value
 LEFT JOIN itm_organ_net d on d.NET_ID = b.ITM_NETGROUP_ID
 -- 只要app的一个资源上云了 就说明上云了
-LEFT JOIN (SELECT servicename,itm_hardware_resources_areacode,concat(max(CASE WHEN itm_hardware_resources_cntype = '云主机' then 1 else 0 end),'') as cloud_flag
-from bi_itm_hardware_resources where servicename is not null and servicename != '' group by servicename,itm_hardware_resources_areacode) e
+LEFT JOIN (SELECT servicename,itm_hardware_resources_areacode,concat(max(CASE WHEN itm_hardware_resources_cntype = '云主机' then 1 else 0 end),'') as cloud_flag,cloud
+from bi_itm_hardware_resources where servicename is not null and servicename != '' group by servicename,itm_hardware_resources_areacode,cloud) e
 on b.ITM_APP_NAME= e.servicename
 left join pub_organ f
 on b.ORGAN_ID = f.`CODE`
@@ -1359,7 +1361,8 @@ d.net_name as net_name,
 e.cloud_flag as cloud_flag,
 f.`SHORT_NAME` as organ_name,
 e.itm_hardware_resources_areacode as itm_hardware_resources_areacode,
-b.on_line as on_line
+b.on_line as on_line,
+e.cloud
 from (
 select distinct date_format(dt_d,'%Y%m') as thedvalue from bi_m_date where dt_d >= '2021-01-01' and dt_d < '2023-11-09') a
 left join itm_app b
@@ -1367,8 +1370,8 @@ on a.thedvalue >= date_format(b.create_time,'%Y%m')
 LEFT JOIN m_com_dict c on b.app_type=c.value
 LEFT JOIN itm_organ_net d on d.NET_ID = b.ITM_NETGROUP_ID  
 -- 只要app的一个资源上云了 就说明上云了
-LEFT JOIN (SELECT servicename,itm_hardware_resources_areacode,concat(max(CASE WHEN itm_hardware_resources_cntype = '云主机' then 1 else 0 end),'') as cloud_flag
-from bi_itm_hardware_resources where servicename is not null and servicename != '' group by servicename,itm_hardware_resources_areacode) e
+LEFT JOIN (SELECT servicename,itm_hardware_resources_areacode,concat(max(CASE WHEN itm_hardware_resources_cntype = '云主机' then 1 else 0 end),'') as cloud_flag,cloud
+from bi_itm_hardware_resources where servicename is not null and servicename != '' group by servicename,itm_hardware_resources_areacode,cloud) e
 on b.ITM_APP_NAME= e.servicename
 left join pub_organ f
 on b.ORGAN_ID = f.`CODE`
@@ -1387,7 +1390,8 @@ d.net_name as net_name,
 e.cloud_flag as cloud_flag,
 f.`SHORT_NAME` as organ_name,
 e.itm_hardware_resources_areacode as itm_hardware_resources_areacode,
-b.on_line as on_line
+b.on_line as on_line,
+e.cloud
 from (
 select distinct date_format(dt_d,'%Y') as thedvalue from bi_m_date where dt_d >= '2021-01-01' and dt_d < '2023-11-09') a
 left join itm_app b
@@ -1395,8 +1399,8 @@ on a.thedvalue >= date_format(b.create_time,'%Y')
 LEFT JOIN m_com_dict c on b.app_type=c.value
 LEFT JOIN itm_organ_net d on d.NET_ID = b.ITM_NETGROUP_ID
 -- 只要app的一个资源上云了 就说明上云了
-LEFT JOIN (SELECT servicename,itm_hardware_resources_areacode,concat(max(CASE WHEN itm_hardware_resources_cntype = '云主机' then 1 else 0 end),'') as cloud_flag
-from bi_itm_hardware_resources where servicename is not null and servicename != '' group by servicename,itm_hardware_resources_areacode) e
+LEFT JOIN (SELECT servicename,itm_hardware_resources_areacode,concat(max(CASE WHEN itm_hardware_resources_cntype = '云主机' then 1 else 0 end),'') as cloud_flag, cloud
+from bi_itm_hardware_resources where servicename is not null and servicename != '' group by servicename,itm_hardware_resources_areacode,cloud) e
 on b.ITM_APP_NAME= e.servicename
 left join pub_organ f
 on b.ORGAN_ID = f.`CODE`