查询设备告警列表
This commit is contained in:
@ -33,6 +33,7 @@ public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
|
||||
|
||||
private final DeviceAlarmMapper baseMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备告警
|
||||
*
|
||||
@ -40,10 +41,11 @@ public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
|
||||
* @return 设备告警
|
||||
*/
|
||||
@Override
|
||||
public DeviceAlarmVo queryById(Long id){
|
||||
public DeviceAlarmVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询设备告警列表
|
||||
*
|
||||
@ -54,10 +56,12 @@ public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
|
||||
@Override
|
||||
public TableDataInfo<DeviceAlarmVo> queryPageList(DeviceAlarmBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DeviceAlarm> lqw = buildQueryWrapper(bo);
|
||||
Page<DeviceAlarmVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
// Page<DeviceAlarmVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
Page<DeviceAlarmVo> result = baseMapper.selectVoPage(bo, pageQuery);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询符合条件的设备告警列表
|
||||
*
|
||||
@ -75,7 +79,7 @@ public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
|
||||
LambdaQueryWrapper<DeviceAlarm> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(DeviceAlarm::getId);
|
||||
lqw.eq(bo.getDeviceId() != null, DeviceAlarm::getDeviceId, bo.getDeviceId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceAction()), DeviceAlarm::getDeviceAction, bo.getDeviceAction());
|
||||
// lqw.eq(StringUtils.isNotBlank(bo.getDeviceAction()), DeviceAlarm::getDeviceAction, bo.getDeviceAction());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDeviceName()), DeviceAlarm::getDeviceName, bo.getDeviceName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDataSource()), DeviceAlarm::getDataSource, bo.getDataSource());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), DeviceAlarm::getContent, bo.getContent());
|
||||
@ -123,8 +127,8 @@ public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DeviceAlarm entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
private void validEntityBeforeSave(DeviceAlarm entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,8 +140,8 @@ public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user