Commit bed86874 authored by zhuangzhuang's avatar zhuangzhuang

修改增加报警的逻辑

parent 81440563
......@@ -13,6 +13,8 @@ public class AddAlarmLogVo {
private Long ts;
private Integer alarmno;
private List<AlarmData> alarm;
public static class AlarmData {
......@@ -121,6 +123,14 @@ public class AddAlarmLogVo {
this.ts = ts;
}
public Integer getAlarmno() {
return alarmno;
}
public void setAlarmno(Integer alarmno) {
this.alarmno = alarmno;
}
public List<AlarmData> getAlarm() {
return alarm;
}
......
package com.example.tdl.domain.vo;
public class AlarmNoVo {
private Integer mode;
private String transportationNo;
private String warehouseNo;
private String warehouseName;
public Integer getMode() {
return mode;
}
public void setMode(Integer mode) {
this.mode = mode;
}
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
public String getWarehouseNo() {
return warehouseNo;
}
public void setWarehouseNo(String warehouseNo) {
this.warehouseNo = warehouseNo;
}
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
}
......@@ -39,4 +39,6 @@ public interface GatewayMapper {
List<TypeVo> getGatewayType(@Param("companyNo") String companyNo);
AlarmNoVo getByGateway(@Param("SN") String SN,@Param("type") String type);
}
......@@ -75,4 +75,8 @@ public class GatewayService {
public List<TypeVo> getGatewayType(String companyNo){
return gatewayMapper.getGatewayType(companyNo);
}
public AlarmNoVo getByGateway(String SN,String type){
return gatewayMapper.getByGateway(SN,type);
}
}
package com.example.tdl.util;
public class AlarmLogUtil {
public static String ALARM_NONE = "正常";
public static String ALARM_LMin = "过低";
public static String ALARM_EQMax = "等于最大值";
public static String ALARM_UEQMax = "不等于最大值";
public static String ALARM_UMax = "过高";
public static String ALARM_UUMax = "超高";
public static String ALARM_LLMin = "超低";
public static String ALARM_LMaxUMin = "上下限制之间";
public static String ALARM_OFFLINE = "离线";
// public static String ALARM_NONE = " normal";
// public static String ALARM_LMin = " underestimate";
// public static String ALARM_EQMax = " equals the maximum";
// public static String ALARM_UEQMax = " not equal to the maximum";
// public static String ALARM_UMax = " overtop";
// public static String ALARM_UUMax = " ultrahigh";
// public static String ALARM_LLMin = " ultralow";
// public static String ALARM_LMaxUMin = " upper and lower range alarm";
// public static String ALARM_OFFLINE = " off-line";
public static String getDescription(Integer alalrmNo){
String desp = "";
switch (alalrmNo){
case 0 :
desp = ALARM_NONE;
break;
case 1:
desp = ALARM_EQMax;
break;
case 2:
desp = ALARM_UEQMax;
break;
case 3:
desp = ALARM_UMax;
break;
case 4:
desp = ALARM_LMin;
break;
case 5:
desp = ALARM_LMaxUMin;
break;
case 6:
desp = ALARM_UUMax;
break;
case 7:
desp = ALARM_LLMin;
break;
case 99:
desp = ALARM_OFFLINE;
break;
default:
break;
}
return desp;
}
}
......@@ -134,6 +134,13 @@
</if>
</select>
<select id="getByGateway" resultType="com.example.tdl.domain.vo.AlarmNoVo" parameterType="String">
select DISTINCT g.useScene mode, transportationNo, warehouseNo from gateway g INNER JOIN tdldevice t on t.gateway_id = g.id
LEFT JOIN circuit c on c.id = t.circuit_id
LEFT JOIN warehouse w on w.id = t.warehouse_id
where g.SN=#{SN,jdbcType=VARCHAR} and g.type=#{type,jdbcType=VARCHAR}
</select>
<!-- <insert id="addGateway" parameterType="com.example.tdl.domain.vo.AddGatewayVo">
INSERT into gateway VALUES (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment