64850858
2021-06-07 df11956c3c203434d3ef54955a502c466f1382dd
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
@@ -27,6 +27,9 @@
                "ip," +
                "port," +
                "hostAddress," +
                "expires," +
                "registerTime," +
                "keepaliveTime," +
                "online" +
            ") VALUES (" +
                "#{deviceId}," +
@@ -39,6 +42,9 @@
                "#{ip}," +
                "#{port}," +
                "#{hostAddress}," +
                "#{expires}," +
                "#{registerTime}," +
                "#{keepaliveTime}," +
                "#{online}" +
            ")")
    int add(Device device);
@@ -56,6 +62,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 +74,7 @@
    @Delete("DELETE FROM device WHERE deviceId=#{deviceId}")
    int del(String deviceId);
    @Update("UPDATE device SET online=0")
    int outlineForAll();
}