1
0

设备告警

This commit is contained in:
2025-08-29 18:58:16 +08:00
parent e17a64ad57
commit d66fb7d2c2
8 changed files with 35 additions and 34 deletions

View File

@ -1,26 +1,26 @@
package com.fuyuanshen.web.controller.device;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.fuyuanshen.common.idempotent.annotation.RepeatSubmit;
import com.fuyuanshen.common.log.annotation.Log;
import com.fuyuanshen.common.web.core.BaseController;
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
import com.fuyuanshen.common.core.domain.R;
import com.fuyuanshen.common.core.validate.AddGroup;
import com.fuyuanshen.common.core.validate.EditGroup;
import com.fuyuanshen.common.log.enums.BusinessType;
import com.fuyuanshen.common.excel.utils.ExcelUtil;
import com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo;
import com.fuyuanshen.equipment.domain.bo.DeviceAlarmBo;
import com.fuyuanshen.equipment.service.IDeviceAlarmService;
import com.fuyuanshen.common.idempotent.annotation.RepeatSubmit;
import com.fuyuanshen.common.log.annotation.Log;
import com.fuyuanshen.common.log.enums.BusinessType;
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
import com.fuyuanshen.common.web.core.BaseController;
import com.fuyuanshen.equipment.domain.bo.DeviceAlarmBo;
import com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo;
import com.fuyuanshen.equipment.service.IDeviceAlarmService;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 设备告警

View File

@ -153,6 +153,7 @@ public class Device extends TenantEntity {
*/
@Schema(title = "出厂日期")
private Date productionDate;
/**
* 在线状态(0离线1在线)
*/

View File

@ -88,7 +88,7 @@ public class DeviceAlarm extends TenantEntity {
/**
* 报警持续时间
*/
private Date durationTime;
private Long durationTime;
/**
* 0已处理1未处理

View File

@ -99,15 +99,13 @@ public class DeviceAlarmBo extends BaseEntity {
/**
* 报警持续时间
*/
private Date durationTime;
private Long durationTime;
/**
* 报警查询时间
*/
private Date queryTime1;
private Date queryTime2;
private String queryTime1;
private String queryTime2;
/**
* 0已处理1未处理

View File

@ -54,10 +54,12 @@ public class DeviceAlarmVo implements Serializable {
*/
@ExcelProperty(value = "设备名称")
private String deviceName;
/**
* 设备MAC
*/
private String deviceMac;
/**
* 设备IMEI
*/
@ -116,13 +118,13 @@ public class DeviceAlarmVo implements Serializable {
* 报警持续时间
*/
@ExcelProperty(value = "报警持续时间")
private Date durationTime;
private Long durationTime;
/**
* 0已处理1未处理
*/
@ExcelProperty(value = "0已处理1未处理")
private Long treatmentState;
private Integer treatmentState;
}

View File

@ -23,7 +23,6 @@ public interface DeviceAlarmMapper extends BaseMapperPlus<DeviceAlarm, DeviceAla
* @param bo 设备告警
* @return 设备告警
*/
Page<DeviceAlarmVo> selectVoPage(@Param("bo") DeviceAlarmBo bo, PageQuery pageQuery);
Page<DeviceAlarmVo> selectVoPage( Page pageQuery,@Param("bo") DeviceAlarmBo bo);
}

View File

@ -55,9 +55,9 @@ public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
*/
@Override
public TableDataInfo<DeviceAlarmVo> queryPageList(DeviceAlarmBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<DeviceAlarm> lqw = buildQueryWrapper(bo);
// LambdaQueryWrapper<DeviceAlarm> lqw = buildQueryWrapper(bo);
// Page<DeviceAlarmVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
Page<DeviceAlarmVo> result = baseMapper.selectVoPage(bo, pageQuery);
Page<DeviceAlarmVo> result = baseMapper.selectVoPage(pageQuery.build(), bo);
return TableDataInfo.build(result);
}

View File

@ -6,27 +6,28 @@
<!-- 查询设备告警列表 -->
<select id="selectVoPage" resultType="com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo">
select *, d.device_mac as deviceMac, d.device_imei as deviceImei,
select *, d.device_mac as deviceMac, d.device_imei as deviceImei,
d.type_name as deviceTypeName
from device_alarm da
left join device d on da.device_id = d.id
left join device_type dt on dt.id = da.device_type
<where>
<if test="bo.deviceName != null">
and da.device_name = #{deviceName}
and da.device_name = #{bo.deviceName}
</if>
<if test="bo.deviceType != null">
and da.device_type = #{deviceType}
and da.device_type = #{bo.deviceType}
</if>
<if test="bo.deviceAction != null">
and da.device_action = #{deviceAction}
and da.device_action = #{bo.deviceAction}
</if>
<if test="bo.treatmentState != null">
and da.treatmentState = #{bo.treatment_state}
and da.treatment_state = #{bo.treatmentState}
</if>
<if test="bo.queryTime1 != null and bo.queryTime2 != null ">
and da.startTime between #{bo.queryTime1} and #{bo.queryTime2}
and da.start_time between #{bo.queryTime1} and #{bo.queryTime2}
</if>
</where>
</select>
</mapper>