Commit 336f8506 authored by 王晓倩's avatar 王晓倩

报警器添加修改时间字段

parent 04f6991e
...@@ -217,6 +217,7 @@ public class TDetectorInfoController extends BaseController ...@@ -217,6 +217,7 @@ public class TDetectorInfoController extends BaseController
List<TDetectorInfo> detectorList = tDetectorInfoService.selectTDetectorInfoList(detector); List<TDetectorInfo> detectorList = tDetectorInfoService.selectTDetectorInfoList(detector);
if(detectorList.size() > 0){ if(detectorList.size() > 0){
tDetectorInfo.setDetectorId(detectorList.get(0).getDetectorId()); tDetectorInfo.setDetectorId(detectorList.get(0).getDetectorId());
tDetectorInfo.setUpdateTime(new Date());
tDetectorInfoService.updateTDetectorInfo(tDetectorInfo); tDetectorInfoService.updateTDetectorInfo(tDetectorInfo);
continue; continue;
} }
......
...@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="linkman" column="linkman" /> <result property="linkman" column="linkman" />
<result property="phone" column="phone" /> <result property="phone" column="phone" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="alarmTime" column="alarm_time" /> <result property="alarmTime" column="alarm_time" />
<result property="detectorStatus" column="detector_status" /> <result property="detectorStatus" column="detector_status" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
...@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTDetectorInfoVo"> <sql id="selectTDetectorInfoVo">
select detector_id, enterprise_id, user_id, detector_name, detector_code, detector_addr, detector_type, medium, longitude, latitude, iot_no, linkman, phone, create_time, alarm_time, detector_status, is_del, remarks from t_detector_info select detector_id, enterprise_id, user_id, detector_name, detector_code, detector_addr, detector_type, medium, longitude, latitude, iot_no, linkman, phone, create_time, update_time, alarm_time, detector_status, is_del, remarks from t_detector_info
</sql> </sql>
<select id="selectTDetectorInfoList" parameterType="TDetectorInfo" resultMap="TDetectorInfoResult"> <select id="selectTDetectorInfoList" parameterType="TDetectorInfo" resultMap="TDetectorInfoResult">
...@@ -45,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -45,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="linkman != null and linkman != ''"> and linkman = #{linkman}</if> <if test="linkman != null and linkman != ''"> and linkman = #{linkman}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if> <if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="createTime != null "> and create_time = #{createTime}</if> <if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="alarmTime != null "> and alarm_time = #{alarmTime}</if> <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if>
<if test="detectorStatus != null and detectorStatus != ''"> and detector_status = #{detectorStatus}</if> <if test="detectorStatus != null and detectorStatus != ''"> and detector_status = #{detectorStatus}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if> <if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
...@@ -73,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -73,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="linkman != null">linkman,</if> <if test="linkman != null">linkman,</if>
<if test="phone != null">phone,</if> <if test="phone != null">phone,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="alarmTime != null">alarm_time,</if> <if test="alarmTime != null">alarm_time,</if>
<if test="detectorStatus != null">detector_status,</if> <if test="detectorStatus != null">detector_status,</if>
<if test="isDel != null">is_del,</if> <if test="isDel != null">is_del,</if>
...@@ -92,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -92,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="linkman != null">#{linkman},</if> <if test="linkman != null">#{linkman},</if>
<if test="phone != null">#{phone},</if> <if test="phone != null">#{phone},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="alarmTime != null">#{alarmTime},</if> <if test="alarmTime != null">#{alarmTime},</if>
<if test="detectorStatus != null">#{detectorStatus},</if> <if test="detectorStatus != null">#{detectorStatus},</if>
<if test="isDel != null">#{isDel},</if> <if test="isDel != null">#{isDel},</if>
...@@ -174,7 +178,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -174,7 +178,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="phone=case" suffix="end,"> <trim prefix="phone=case" suffix="end,">
<foreach collection="list" item="item" index="index"> <foreach collection="list" item="item" index="index">
<if test="item.phone != null &amp;&amp; item.telephone != ''"> <if test="item.phone != null &amp;&amp; item.phone != ''">
when detector_code=#{item.detectorCode} then #{item.phone} when detector_code=#{item.detectorCode} then #{item.phone}
</if> </if>
</foreach> </foreach>
...@@ -193,6 +197,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -193,6 +197,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="update_time=case" suffix="end,">
<foreach collection="list" item="item" index="index">
<if test="item.updateTime != null">
when detector_code=#{item.detectorCode} then #{item.updateTime}
</if>
</foreach>
</trim>
<trim prefix="alarm_time=case" suffix="end,"> <trim prefix="alarm_time=case" suffix="end,">
<foreach collection="list" item="item" index="index"> <foreach collection="list" item="item" index="index">
<if test="item.alarmTime != null"> <if test="item.alarmTime != null">
...@@ -224,7 +235,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -224,7 +235,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="iotNo != null">iot_no = #{iotNo},</if> <if test="iotNo != null">iot_no = #{iotNo},</if>
<if test="linkman != null">linkman = #{linkman},</if> <if test="linkman != null">linkman = #{linkman},</if>
<if test="phone != null">phone = #{phone},</if> <if test="phone != null">phone = #{phone},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="alarmTime != null">alarm_time = #{alarmTime},</if> <if test="alarmTime != null">alarm_time = #{alarmTime},</if>
<if test="detectorStatus != null">detector_status = #{detectorStatus},</if> <if test="detectorStatus != null">detector_status = #{detectorStatus},</if>
<if test="isDel != null">is_del = #{isDel},</if> <if test="isDel != null">is_del = #{isDel},</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