@@ -148,6 +148,7 @@ public class AlarmController {
|
|||||||
@Parameter(name = "page",description = "当前页",required = true)
|
@Parameter(name = "page",description = "当前页",required = true)
|
||||||
@Parameter(name = "count",description = "每页查询数量",required = true)
|
@Parameter(name = "count",description = "每页查询数量",required = true)
|
||||||
@Parameter(name = "deviceId",description = "设备id")
|
@Parameter(name = "deviceId",description = "设备id")
|
||||||
|
@Parameter(name = "channelId",description = "通道id")
|
||||||
@Parameter(name = "alarmPriority",description = "查询内容")
|
@Parameter(name = "alarmPriority",description = "查询内容")
|
||||||
@Parameter(name = "alarmMethod",description = "查询内容")
|
@Parameter(name = "alarmMethod",description = "查询内容")
|
||||||
@Parameter(name = "alarmType",description = "每页查询数量")
|
@Parameter(name = "alarmType",description = "每页查询数量")
|
||||||
@@ -157,7 +158,8 @@ public class AlarmController {
|
|||||||
public PageInfo<DeviceAlarm> getAll(
|
public PageInfo<DeviceAlarm> getAll(
|
||||||
@RequestParam int page,
|
@RequestParam int page,
|
||||||
@RequestParam int count,
|
@RequestParam int count,
|
||||||
@RequestParam(required = false) String deviceId,
|
@RequestParam(required = false) String deviceId,
|
||||||
|
@RequestParam(required = false) String channelId,
|
||||||
@RequestParam(required = false) String alarmPriority,
|
@RequestParam(required = false) String alarmPriority,
|
||||||
@RequestParam(required = false) String alarmMethod,
|
@RequestParam(required = false) String alarmMethod,
|
||||||
@RequestParam(required = false) String alarmType,
|
@RequestParam(required = false) String alarmType,
|
||||||
@@ -186,7 +188,7 @@ public class AlarmController {
|
|||||||
throw new ControllerException(ErrorCode.ERROR400.getCode(), "endTime格式为" + DateUtil.PATTERN);
|
throw new ControllerException(ErrorCode.ERROR400.getCode(), "endTime格式为" + DateUtil.PATTERN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return deviceAlarmService.getAllAlarm(page, count, deviceId, alarmPriority, alarmMethod,
|
return deviceAlarmService.getAllAlarm(page, count, deviceId, channelId, alarmPriority, alarmMethod,
|
||||||
alarmType, startTime, endTime);
|
alarmType, startTime, endTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public interface DeviceAlarmMapper {
|
|||||||
" SELECT * FROM wvp_device_alarm " +
|
" SELECT * FROM wvp_device_alarm " +
|
||||||
" WHERE 1=1 " +
|
" WHERE 1=1 " +
|
||||||
" <if test=\"deviceId != null\" > AND device_id = #{deviceId}</if>" +
|
" <if test=\"deviceId != null\" > AND device_id = #{deviceId}</if>" +
|
||||||
|
" <if test=\"channelId != null\" > AND channel_id = #{channelId}</if>" +
|
||||||
" <if test=\"alarmPriority != null\" > AND alarm_priority = #{alarmPriority} </if>" +
|
" <if test=\"alarmPriority != null\" > AND alarm_priority = #{alarmPriority} </if>" +
|
||||||
" <if test=\"alarmMethod != null\" > AND alarm_method = #{alarmMethod} </if>" +
|
" <if test=\"alarmMethod != null\" > AND alarm_method = #{alarmMethod} </if>" +
|
||||||
" <if test=\"alarmType != null\" > AND alarm_type = #{alarmType} </if>" +
|
" <if test=\"alarmType != null\" > AND alarm_type = #{alarmType} </if>" +
|
||||||
@@ -33,7 +34,7 @@ public interface DeviceAlarmMapper {
|
|||||||
" <if test=\"endTime != null\" > AND alarm_time <= #{endTime} </if>" +
|
" <if test=\"endTime != null\" > AND alarm_time <= #{endTime} </if>" +
|
||||||
" ORDER BY alarm_time ASC " +
|
" ORDER BY alarm_time ASC " +
|
||||||
" </script>"})
|
" </script>"})
|
||||||
List<DeviceAlarm> query(@Param("deviceId") String deviceId, @Param("alarmPriority") String alarmPriority, @Param("alarmMethod") String alarmMethod,
|
List<DeviceAlarm> query(@Param("deviceId") String deviceId, @Param("channelId") String channelId, @Param("alarmPriority") String alarmPriority, @Param("alarmMethod") String alarmMethod,
|
||||||
@Param("alarmType") String alarmType, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
@Param("alarmType") String alarmType, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public interface IDeviceAlarmService {
|
|||||||
* @param endTime 结束时间
|
* @param endTime 结束时间
|
||||||
* @return 报警列表
|
* @return 报警列表
|
||||||
*/
|
*/
|
||||||
PageInfo<DeviceAlarm> getAllAlarm(int page, int count, String deviceId, String alarmPriority, String alarmMethod,
|
PageInfo<DeviceAlarm> getAllAlarm(int page, int count, String deviceId, String channelId, String alarmPriority, String alarmMethod,
|
||||||
String alarmType, String startTime, String endTime);
|
String alarmType, String startTime, String endTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
|
|||||||
private DeviceAlarmMapper deviceAlarmMapper;
|
private DeviceAlarmMapper deviceAlarmMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<DeviceAlarm> getAllAlarm(int page, int count, String deviceId, String alarmPriority, String alarmMethod, String alarmType, String startTime, String endTime) {
|
public PageInfo<DeviceAlarm> getAllAlarm(int page, int count, String deviceId, String channelId, String alarmPriority, String alarmMethod, String alarmType, String startTime, String endTime) {
|
||||||
PageHelper.startPage(page, count);
|
PageHelper.startPage(page, count);
|
||||||
List<DeviceAlarm> all = deviceAlarmMapper.query(deviceId, alarmPriority, alarmMethod, alarmType, startTime, endTime);
|
List<DeviceAlarm> all = deviceAlarmMapper.query(deviceId, channelId, alarmPriority, alarmMethod, alarmType, startTime, endTime);
|
||||||
return new PageInfo<>(all);
|
return new PageInfo<>(all);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user