|
@@ -71,14 +71,14 @@ public class AlarmRecordController extends BaseController {
|
|
|
|
|
|
@ApiOperation("业务类型统计")
|
|
|
@GetMapping("/list/bizType")
|
|
|
- public AjaxResult listBizType(@ApiParam(value = "开始时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @ApiParam(value = "结束时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
+ public AjaxResult listBizType(@ApiParam(value = "开始时间yyyy-mm-dd") String start, @ApiParam(value = "结束时间yyyy-mm-dd") String end) {
|
|
|
List<BizTypeVO> list = new ArrayList();
|
|
|
String sql = "SELECT b.obj_type,COUNT(*) num FROM alarm_record a,biz_obj b WHERE a.obj_id=b.obj_id";
|
|
|
Vector<Object> v = new Vector<>();
|
|
|
if (start != null && end != null) {
|
|
|
sql += " AND a.alarm_time BETWEEN ? AND ?";
|
|
|
v.add(start);
|
|
|
- v.add(end);
|
|
|
+ v.add(end + " 23:59:59");
|
|
|
}
|
|
|
sql += " GROUP BY b.obj_type";
|
|
|
List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, v.toArray());
|
|
@@ -107,7 +107,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
|
|
|
@ApiOperation("业务组件统计")
|
|
|
@GetMapping("/list/bizObj")
|
|
|
- public AjaxResult listBizObj(@ApiParam(value = "业务类型") String type, @ApiParam(value = "开始时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @ApiParam(value = "结束时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
+ public AjaxResult listBizObj(@ApiParam(value = "业务类型") String type, @ApiParam(value = "开始时间yyyy-mm-dd") String start, @ApiParam(value = "结束时间yyyy-mm-dd") String end) {
|
|
|
List<BizTypeVO> list = new ArrayList();
|
|
|
String sql = "SELECT b.obj_id,b.obj_name,COUNT(*) num FROM alarm_record a,biz_obj b WHERE a.obj_id=b.obj_id";
|
|
|
Vector<Object> v = new Vector<>();
|
|
@@ -118,7 +118,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
if (start != null && end != null) {
|
|
|
sql += " AND a.alarm_time BETWEEN ? AND ?";
|
|
|
v.add(start);
|
|
|
- v.add(end);
|
|
|
+ v.add(end + " 23:59:59");
|
|
|
}
|
|
|
sql += " GROUP BY b.obj_id,b.obj_name";
|
|
|
List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, v.toArray());
|
|
@@ -138,7 +138,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
|
|
|
@ApiOperation("业务指标统计")
|
|
|
@GetMapping("/list/getMetrics")
|
|
|
- public AjaxResult getMetrics(@ApiParam(value = "对象ID") Long objId, @ApiParam(value = "开始时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @ApiParam(value = "结束时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
+ public AjaxResult getMetrics(@ApiParam(value = "对象ID") Long objId, @ApiParam(value = "开始时间yyyy-mm-dd") String start, @ApiParam(value = "结束时间yyyy-mm-dd") String end) {
|
|
|
List<BizTypeVO> list = new ArrayList();
|
|
|
String sql = "SELECT a.obj_metrics_id,b.metrics_name,COUNT(*) num FROM alarm_record a,biz_obj_metrics b WHERE a.obj_metrics_id=b.obj_metrics_id";
|
|
|
Vector<Object> v = new Vector<>();
|
|
@@ -149,7 +149,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
if (start != null && end != null) {
|
|
|
sql += " AND a.alarm_time BETWEEN ? AND ?";
|
|
|
v.add(start);
|
|
|
- v.add(end);
|
|
|
+ v.add(end + " 23:59:59");
|
|
|
}
|
|
|
sql += " GROUP by a.obj_metrics_id,b.metrics_name order by num desc";
|
|
|
List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, v.toArray());
|
|
@@ -168,7 +168,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
|
|
|
@ApiOperation("应用组件统计")
|
|
|
@GetMapping("/list/bizSort")
|
|
|
- public AjaxResult listBizSort(@ApiParam(value = "分类") String bizType, @ApiParam(value = "开始时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @ApiParam(value = "结束时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
+ public AjaxResult listBizSort(@ApiParam(value = "分类") String bizType, @ApiParam(value = "开始时间yyyy-mm-dd") String start, @ApiParam(value = "结束时间yyyy-mm-dd") String end) {
|
|
|
List<BizSortVO> list = new ArrayList();
|
|
|
// 暂时使用模拟数据
|
|
|
String sql = "SELECT a.obj_id,b.obj_name,b.obj_type,COUNT(*) num FROM alarm_record a,biz_obj b WHERE a.obj_id=b.obj_id";
|
|
@@ -180,7 +180,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
if (start != null && end != null) {
|
|
|
sql += " AND a.alarm_time BETWEEN ? AND ?";
|
|
|
v.add(start);
|
|
|
- v.add(end);
|
|
|
+ v.add(end + " 23:59:59");
|
|
|
}
|
|
|
sql += " GROUP BY a.obj_id,b.obj_name,b.obj_type";
|
|
|
List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, v.toArray());
|
|
@@ -203,7 +203,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
|
|
|
@ApiOperation("系统压力排名")
|
|
|
@GetMapping("/list/bizAccess")
|
|
|
- public AjaxResult listBizAccess(@ApiParam(value = "开始时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @ApiParam(value = "结束时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
+ public AjaxResult listBizAccess(@ApiParam(value = "开始时间yyyy-mm-dd") String start, @ApiParam(value = "结束时间yyyy-mm-dd") String end) {
|
|
|
List<BizAccessVO> list = new ArrayList<>();
|
|
|
// //还是得先用模拟数据。
|
|
|
String sql = "SELECT model_id,model_name FROM biz_model";
|
|
@@ -220,7 +220,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
if (start != null && end != null) {
|
|
|
sql1 += " AND alarm_time BETWEEN ? AND ?";
|
|
|
v.add(start);
|
|
|
- v.add(end);
|
|
|
+ v.add(end + " 23:59:59");
|
|
|
}
|
|
|
Long num = jdbcTemplate.queryForObject(sql1, Long.class, v.toArray());
|
|
|
vo.setNum(num);
|
|
@@ -234,7 +234,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
if (start != null && end != null) {
|
|
|
sql2 += " AND CREATE_TIME BETWEEN ? AND ?";
|
|
|
v1.add(start);
|
|
|
- v1.add(end);
|
|
|
+ v1.add(end + " 23:59:59");
|
|
|
}
|
|
|
Long access = jdbcTemplate.queryForObject(sql2, Long.class, v1.toArray());
|
|
|
vo.setAccess(access);
|
|
@@ -262,7 +262,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
|
|
|
@ApiOperation("组件告警数量排名")
|
|
|
@GetMapping("/list/objAlarm")
|
|
|
- public AjaxResult objAlarm(@ApiParam(value = "对象ID") Long modelId, @ApiParam(value = "开始时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @ApiParam(value = "结束时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
+ public AjaxResult objAlarm(@ApiParam(value = "对象ID") Long modelId, @ApiParam(value = "开始时间yyyy-mm-dd") String start, @ApiParam(value = "结束时间yyyy-mm-dd") String end) {
|
|
|
|
|
|
List<BizSortVO> list = new ArrayList();
|
|
|
String sql = "SELECT a.obj_id,c.obj_name,COUNT(*) num FROM alarm_record a,biz_model_detail b,biz_obj c WHERE a.obj_id=b.obj_id AND b.obj_id=c.obj_id";
|
|
@@ -277,7 +277,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
if (start != null && end != null) {
|
|
|
sql += " AND a.alarm_time BETWEEN ? AND ?";
|
|
|
v.add(start);
|
|
|
- v.add(end);
|
|
|
+ v.add(end + " 23:59:59");
|
|
|
}
|
|
|
sql += " GROUP BY a.obj_id,c.obj_name order by num desc";
|
|
|
List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, v.toArray());
|
|
@@ -293,7 +293,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
|
|
|
@ApiOperation("组件压力排名")
|
|
|
@GetMapping("/list/objAccess")
|
|
|
- public AjaxResult objAccess(@ApiParam(value = "对象ID") Long modelId, @ApiParam(value = "开始时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @ApiParam(value = "结束时间yyyy-mm-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
+ public AjaxResult objAccess(@ApiParam(value = "对象ID") Long modelId, @ApiParam(value = "开始时间yyyy-mm-dd") String start, @ApiParam(value = "结束时间yyyy-mm-dd") String end) {
|
|
|
// 依然得用模拟数据
|
|
|
Map<String, Object> result = new HashMap<>(16);
|
|
|
List<BizAccessVO> list = new ArrayList<>();
|
|
@@ -324,7 +324,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
totSql += " AND CREATE_TIME BETWEEN ? AND ?";
|
|
|
errSql += " AND CREATE_TIME BETWEEN ? AND ?";
|
|
|
v.add(start);
|
|
|
- v.add(end);
|
|
|
+ v.add(end + " 23:59:59");
|
|
|
}
|
|
|
|
|
|
Long access = jdbcTemplate.queryForObject(totSql, Long.class, v.toArray());
|
|
@@ -355,7 +355,7 @@ public class AlarmRecordController extends BaseController {
|
|
|
totSql += " AND CREATE_TIME BETWEEN ? AND ?";
|
|
|
errSql += " AND CREATE_TIME BETWEEN ? AND ?";
|
|
|
v.add(start);
|
|
|
- v.add(end);
|
|
|
+ v.add(end + " 23:59:59");
|
|
|
}
|
|
|
|
|
|
totSql += " group by create_time";
|