|
@@ -83,21 +83,6 @@ public class AlarmSettingController {
|
|
|
boolean result = alarmSettingService.insertBatch(listAlarmSetting);
|
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
|
}
|
|
|
- /**
|
|
|
- * 根据id查询报警设置数据
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @RequestMapping(value = "selectById", method = RequestMethod.GET)
|
|
|
- @ApiOperation(value = "根据id查询报警配置数据")
|
|
|
- public AjaxMessage<AlarmSetting> selectById(@RequestParam Integer id) {
|
|
|
- if(id==null) {
|
|
|
- return new AjaxMessage<>(ResultStatus.PARAM_ERROR);
|
|
|
- }
|
|
|
- AlarmSetting result = alarmSettingService.selectById(id);
|
|
|
- return new AjaxMessage<>(ResultStatus.OK, result);
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 分页查询报警设置数据
|
|
@@ -111,9 +96,11 @@ public class AlarmSettingController {
|
|
|
public AjaxMessage<Pagination<AlarmSettingDto>> selectPage(
|
|
|
@ApiParam(value = "页数", required = true)@RequestParam Integer pageNum,
|
|
|
@ApiParam(value = "条数", required = true)@RequestParam Integer pageSize,
|
|
|
+ @ApiParam(value = "id", required = false) @RequestParam(required = false) Integer id,
|
|
|
@ApiParam(value = "报警参数", required = false) @RequestParam(required = false) String attributeName,
|
|
|
@ApiParam(value = "场景id", required = false) @RequestParam(required = false) Integer sceneId) {
|
|
|
AlarmSettingDto alarmSettingDto=new AlarmSettingDto();
|
|
|
+ alarmSettingDto.setId(id);
|
|
|
alarmSettingDto.setAttributeName(attributeName);
|
|
|
alarmSettingDto.setSceneId(sceneId);
|
|
|
IPage<AlarmSettingDto> iPage = new Page<>(pageNum, pageSize);
|
|
@@ -121,4 +108,19 @@ public class AlarmSettingController {
|
|
|
Pagination<AlarmSettingDto> pages = new Pagination<>(iPage);
|
|
|
return new AjaxMessage<>(ResultStatus.OK, pages);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 根据设备id查询属性信息
|
|
|
+ *
|
|
|
+ * @param deviceId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "selectAttributes", method = RequestMethod.GET)
|
|
|
+ @ApiOperation(value = "根据设备id查询属性信息")
|
|
|
+ public AjaxMessage<List<AlarmSettingDto>> selectAttributes(@RequestParam Integer deviceId) {
|
|
|
+ if(deviceId==null) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.PARAM_ERROR);
|
|
|
+ }
|
|
|
+ List<AlarmSettingDto> result = alarmSettingService.selectAttributes(deviceId);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, result);
|
|
|
+ }
|
|
|
}
|