Commit 57912fea authored by 王晓倩's avatar 王晓倩

探测器报警时间处理

parent bfcb8b20
......@@ -327,6 +327,7 @@ public class TDetectorReportController extends BaseController
tDetectorInfo.setDetectorStatus("2");
tDetectorInfo.setAlarmTime(dto.getAlarmTime());
}
tDetectorInfo.setUpdateTime(new Date());
}
// else{
// if(!StringUtils.isEmpty(dto.getDetectorStatus()) && dto.getDetectorStatus().equals("0")){
......@@ -447,6 +448,7 @@ public class TDetectorReportController extends BaseController
if(!StringUtils.isEmpty(tDetectorReportDataForm.getDeviceStatusId()) && "1".equals((tDetectorReportDataForm.getDeviceStatusId()))){
detectorInfo.setDetectorStatus("0"); // 设备表状态 0正常,1故障(掉线)
detectorInfo.setAlarmTime(null);
detectorInfo.setUpdateTime(new Date());
}else{
if(!StringUtils.isEmpty(tDetectorReportDataForm.getDeviceType()) && tDetectorReportDataForm.getDeviceType().equals("1")){
if(!StringUtils.isEmpty(tDetectorReportDataForm.getDeviceStatusId()) && new ArrayList<String>(Arrays.asList("7","9")).contains((tDetectorReportDataForm.getDeviceStatusId()))){
......@@ -459,6 +461,7 @@ public class TDetectorReportController extends BaseController
// detectorInfo.setDetectorStatus("2");
// }
detectorInfo.setAlarmTime(tDetectorReportDataForm.getCreateTime());
detectorInfo.setUpdateTime(new Date());
}
tDetectorInfoService.updateTDetectorInfo(detectorInfo);
......
......@@ -212,9 +212,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="alarm_time=case" suffix="end,">
<foreach collection="list" item="item" index="index">
<if test="item.alarmTime != null">
when detector_code=#{item.detectorCode} then #{item.alarmTime}
</if>
</foreach>
</trim>
</trim>
......@@ -239,7 +237,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="linkman != null">linkman = #{linkman},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="alarmTime != null">alarm_time = #{alarmTime},</if>
alarm_time = #{alarmTime},
<if test="detectorStatus != null">detector_status = #{detectorStatus},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
......
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