From 97a17d0849a1b76ed99dee09d371bb6afa2c7bd1 Mon Sep 17 00:00:00 2001 From: lawrencehj <1934378145@qq.com> Date: 星期二, 22 六月 2021 11:54:54 +0800 Subject: [PATCH] 修正用户停止播放后API代理抛错误问题 --- src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java index f6e328b..c70eda3 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java @@ -27,6 +27,11 @@ "ip," + "port," + "hostAddress," + + "expires," + + "registerTime," + + "keepaliveTime," + + "createTime," + + "updateTime," + "online" + ") VALUES (" + "#{deviceId}," + @@ -39,13 +44,18 @@ "#{ip}," + "#{port}," + "#{hostAddress}," + + "#{expires}," + + "#{registerTime}," + + "#{keepaliveTime}," + + "#{createTime}," + + "#{updateTime}," + "#{online}" + ")") int add(Device device); @Update(value = {" <script>" + "UPDATE device " + - "SET deviceId='${deviceId}'" + + "SET updateTime='${updateTime}'" + "<if test=\"name != null\">, name='${name}'</if>" + "<if test=\"manufacturer != null\">, manufacturer='${manufacturer}'</if>" + "<if test=\"model != null\">, model='${model}'</if>" + @@ -56,6 +66,9 @@ "<if test=\"port != null\">, port=${port}</if>" + "<if test=\"hostAddress != null\">, hostAddress='${hostAddress}'</if>" + "<if test=\"online != null\">, online=${online}</if>" + + "<if test=\"registerTime != null\">, registerTime='${registerTime}'</if>" + + "<if test=\"keepaliveTime != null\">, keepaliveTime='${keepaliveTime}'</if>" + + "<if test=\"expires != null\">, expires=${expires}</if>" + "WHERE deviceId='${deviceId}'"+ " </script>"}) int update(Device device); @@ -65,4 +78,7 @@ @Delete("DELETE FROM device WHERE deviceId=#{deviceId}") int del(String deviceId); + + @Update("UPDATE device SET online=0") + int outlineForAll(); } -- Gitblit v1.8.0