Commit d7c554ef authored by 王晓倩's avatar 王晓倩

探测器报警时间类型修改

parent 579f8849
...@@ -308,6 +308,7 @@ public class TDetectorReportController extends BaseController ...@@ -308,6 +308,7 @@ public class TDetectorReportController extends BaseController
try { try {
for(TDetectorInfoDTO dto : tDetectorInfoDTOList){ for(TDetectorInfoDTO dto : tDetectorInfoDTOList){
TDetectorInfo tDetectorInfo = new TDetectorInfo(); TDetectorInfo tDetectorInfo = new TDetectorInfo();
tDetectorInfo.setDetectorCode(dto.getDeviceCode());
// 1探测器 // 1探测器
if(!StringUtils.isEmpty(dto.getDeviceType()) && dto.getDeviceType().equals("1")) { if(!StringUtils.isEmpty(dto.getDeviceType()) && dto.getDeviceType().equals("1")) {
...@@ -316,8 +317,10 @@ public class TDetectorReportController extends BaseController ...@@ -316,8 +317,10 @@ public class TDetectorReportController extends BaseController
tDetectorInfo.setAlarmTime(null); tDetectorInfo.setAlarmTime(null);
} else if (new ArrayList<String>(Arrays.asList("7", "9")).contains(dto.getDeviceStatus())) { } else if (new ArrayList<String>(Arrays.asList("7", "9")).contains(dto.getDeviceStatus())) {
tDetectorInfo.setDetectorStatus("1"); tDetectorInfo.setDetectorStatus("1");
tDetectorInfo.setAlarmTime(dto.getAlarmTime());
} else { } else {
tDetectorInfo.setDetectorStatus("2"); tDetectorInfo.setDetectorStatus("2");
tDetectorInfo.setAlarmTime(dto.getAlarmTime());
} }
} }
// else{ // else{
......
...@@ -69,7 +69,7 @@ public class TDetectorInfo extends BaseEntity ...@@ -69,7 +69,7 @@ public class TDetectorInfo extends BaseEntity
private Date creatTime; private Date creatTime;
/** 报警时间 */ /** 报警时间 */
private Date alarmTime; private String alarmTime;
/** 设备状态 */ /** 设备状态 */
@Excel(name = "设备状态") @Excel(name = "设备状态")
...@@ -210,11 +210,11 @@ public class TDetectorInfo extends BaseEntity ...@@ -210,11 +210,11 @@ public class TDetectorInfo extends BaseEntity
this.creatTime = creatTime; this.creatTime = creatTime;
} }
public Date getAlarmTime() { public String getAlarmTime() {
return alarmTime; return alarmTime;
} }
public void setAlarmTime(Date alarmTime) { public void setAlarmTime(String alarmTime) {
this.alarmTime = alarmTime; this.alarmTime = alarmTime;
} }
......
...@@ -37,7 +37,7 @@ public class TDetectorReportDataForm { ...@@ -37,7 +37,7 @@ public class TDetectorReportDataForm {
//创建时间 //创建时间
@NotEmpty(message="上报时间必填") @NotEmpty(message="上报时间必填")
private Date createTime; private String createTime;
} }
...@@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.userId,jdbcType=INTEGER}, #{item.detectorName,jdbcType=VARCHAR}, #{item.detectorCode,jdbcType=VARCHAR}, #{item.userId,jdbcType=INTEGER}, #{item.detectorName,jdbcType=VARCHAR}, #{item.detectorCode,jdbcType=VARCHAR},
#{item.detectorAddr,jdbcType=VARCHAR}, #{item.detectorType,jdbcType=VARCHAR}, #{item.medium,jdbcType=VARCHAR}, #{item.detectorAddr,jdbcType=VARCHAR}, #{item.detectorType,jdbcType=VARCHAR}, #{item.medium,jdbcType=VARCHAR},
#{item.longitude,jdbcType=DECIMAL}, #{item.latitude,jdbcType=DECIMAL}, #{item.linkman,jdbcType=VARCHAR}, #{item.longitude,jdbcType=DECIMAL}, #{item.latitude,jdbcType=DECIMAL}, #{item.linkman,jdbcType=VARCHAR},
#{item.phone,jdbcType=VARCHAR}, #{item.createTime,jdbcType=VARCHAR} #{item.phone,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}
) )
</foreach> </foreach>
</insert> </insert>
...@@ -209,9 +209,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -209,9 +209,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="item.alarmTime != null"> <if test="item.alarmTime != null">
when detector_code=#{item.detectorCode} then #{item.alarmTime} when detector_code=#{item.detectorCode} then #{item.alarmTime}
</if> </if>
<if test="item.alarmTime = null">
when detector_code=#{item.detectorCode} then null
</if>
</foreach> </foreach>
</trim> </trim>
</trim> </trim>
......
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