Browse Source

报警信息修改

wangli 4 years ago
parent
commit
df3d8e8f1c

+ 1 - 1
sms_water/src/main/java/com/huaxu/dao/AlarmDetailMapper.java

@@ -43,7 +43,7 @@ public interface AlarmDetailMapper {
      * 单条删除设备
      * @return
      */
-    Integer suspendedById( @Param("id") Integer id, @Param("satte") Integer state);
+    Integer suspendedById( @Param("id") Integer id, @Param("state") Integer state);
 
     /**
      * 修改设备信息

+ 5 - 0
sms_water/src/main/java/com/huaxu/dto/AlarmDetailsDto.java

@@ -31,6 +31,11 @@ public class AlarmDetailsDto extends AlarmDetailsEntity {
     private BigDecimal pointX;
     @ApiModelProperty("维度")
     private BigDecimal pointY;
+    @ApiModelProperty("持续时间,单位分钟")
+    private Integer duration;
+
+    @ApiModelProperty(value ="报警参数")
+    private String attributeName;
 
     @ApiModelProperty(value ="查询条件:场景名称/设备名称",hidden = true)
     private String condition;

+ 8 - 0
sms_water/src/main/java/com/huaxu/entity/AlarmDetailsEntity.java

@@ -39,6 +39,14 @@ public class AlarmDetailsEntity implements Serializable {
     private Integer attributeId;
     @ApiModelProperty(value = "当前数值")
     private BigDecimal alarmValue;
+    @ApiModelProperty(value = "最小告警数值")
+    private BigDecimal minValue;
+    @ApiModelProperty(value = "最大告警数值")
+    private BigDecimal maxValue;
+
+
+
+
     @ApiModelProperty(value = "报警详情")
     private String alarmContent;
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")

+ 5 - 0
sms_water/src/main/resources/mapper/AlarmDetailMapper.xml

@@ -22,7 +22,11 @@
             ,a.CREATE_BY as "createBy"
             ,a.DATE_UPDATE as "dateUpdate"
             ,a.UPDATE_BY as "updateBy"
+            ,a.MIN_VALUE as "minValue"
+            ,a.MAX_VALUE as "maxValue"
 
+            ,(case when ALARM_END_TIME is not null then timestampdiff(MINUTE,a.ALARM_END_TIME,a.ALARM_START_TIME) else null end ) as "duration"
+            ,att.`NAME` as "attributeName"
             ,s.SCENE_NAME as "sceneName"
             ,d.DEVICE_NAME as "deviceName"
             ,t.DEVICE_TYPE as "devcieType"
@@ -35,6 +39,7 @@
         left join sms_device d on a.DEVICE_ID =d.id and d.`STATUS` = 1
         left join sms_scene s on d.SCENE_ID =s.id and s.`STATUS` =1
         left join sms_device_type t on d.DEVICE_TYPE_ID =t.ID
+        left join sms_device_attribute att on att.id=a.ATTRIBUTE_ID
     </sql>
     <select id="selectById" resultType="com.huaxu.dto.AlarmDetailsDto">
         select