Преглед на файлове

应急端更新添加sql监控

hefeng преди 5 години
родител
ревизия
69690b4431
променени са 1 файла, в които са добавени 19 реда и са изтрити 4 реда
  1. 19 4
      src/main/java/com/chinaitop/depot/system/mapper/TUrlConfigMapper.xml

+ 19 - 4
src/main/java/com/chinaitop/depot/system/mapper/TUrlConfigMapper.xml

@@ -262,7 +262,7 @@
262
 			tuc.id,
262
 			tuc.id,
263
 			tuc.intranet_url,
263
 			tuc.intranet_url,
264
 			tuc.extranet_url,
264
 			tuc.extranet_url,
265
-			IF(ISNULL(dv.updateStatus),'未更新',dv.updateStatus) remark,
265
+			CONCAT(IF(ISNULL(dv.updateStatus),'war包未更新,','war包已更新,'),IF(ISNULL(usql.updateStatus),'sql未更新','sql已更新'))  remark,
266
 			tuc.user_type,
266
 			tuc.user_type,
267
 			oi.org_name
267
 			oi.org_name
268
 		FROM
268
 		FROM
@@ -277,7 +277,16 @@
277
 					SELECT MAX(version_number) FROM depot_software_version WHERE depot_id = '0000' and war_name like '%.war')
277
 					SELECT MAX(version_number) FROM depot_software_version WHERE depot_id = '0000' and war_name like '%.war')
278
 			GROUP BY b.org_id
278
 			GROUP BY b.org_id
279
 		) dv on dv.org_id = tuc.org_id
279
 		) dv on dv.org_id = tuc.org_id
280
-		 <where>
280
+		LEFT JOIN(
281
+			SELECT b.org_id,'已更新' updateStatus 
282
+			FROM depot_software_version a
283
+			INNER JOIN t_url_config b on a.depot_id = b.id
284
+			WHERE a.depot_id != '0000' AND a.war_name like '%.sql' and
285
+				a.version_number = (
286
+					SELECT MAX(version_number) FROM depot_software_version WHERE depot_id = '0000' and war_name like '%.sql')
287
+			GROUP BY b.org_id
288
+		) usql on usql.org_id = tuc.org_id
289
+		<where>
281
 				<if test="intranetUrl != null and intranetUrl != ''">
290
 				<if test="intranetUrl != null and intranetUrl != ''">
282
 					and tuc.intranet_url like '%${intranetUrl}%'
291
 					and tuc.intranet_url like '%${intranetUrl}%'
283
 				</if>
292
 				</if>
@@ -286,10 +295,16 @@
286
 				</if>
295
 				</if>
287
 				<if test="updateStatus != null and updateStatus != ''">
296
 				<if test="updateStatus != null and updateStatus != ''">
288
 					<if test="updateStatus == 0">
297
 					<if test="updateStatus == 0">
289
-						and dv.updateStatus is null
298
+						and dv.updateStatus is null and usql.updateStatus is null
290
 					</if>
299
 					</if>
291
 					<if test="updateStatus == 1">
300
 					<if test="updateStatus == 1">
292
-						and dv.updateStatus = '已更新'
301
+						and dv.updateStatus = '已更新' and usql.updateStatus = '已更新'
302
+					</if>
303
+					<if test="updateStatus == 2">
304
+						and dv.updateStatus = '已更新' and usql.updateStatus is null
305
+					</if>
306
+					<if test="updateStatus == 3">
307
+						and usql.updateStatus = '已更新' and dv.updateStatus is null
293
 					</if>
308
 					</if>
294
 				</if>
309
 				</if>
295
 		</where>
310
 		</where>