648540858
2023-02-14 bdc0f83e29281bb46c5fe7a6eb6562f7f0e616af
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
@@ -61,6 +61,7 @@
                "expires," +
                "registerTime," +
                "keepaliveTime," +
                "keepaliveIntervalTime," +
                "createTime," +
                "updateTime," +
                "charset," +
@@ -88,6 +89,7 @@
                "#{expires}," +
                "#{registerTime}," +
                "#{keepaliveTime}," +
                "#{keepaliveIntervalTime}," +
                "#{createTime}," +
                "#{updateTime}," +
                "#{charset}," +
@@ -117,12 +119,15 @@
                "<if test=\"online != null\">, online=#{online}</if>" +
                "<if test=\"registerTime != null\">, registerTime=#{registerTime}</if>" +
                "<if test=\"keepaliveTime != null\">, keepaliveTime=#{keepaliveTime}</if>" +
                "<if test=\"keepaliveIntervalTime != null\">, keepaliveIntervalTime=#{keepaliveIntervalTime}</if>" +
                "<if test=\"expires != null\">, expires=#{expires}</if>" +
                "WHERE deviceId=#{deviceId}"+
            " </script>"})
    int update(Device device);
    @Select("SELECT " +
    @Select(
            " <script>" +
            "SELECT " +
            "deviceId, " +
            "coalesce(custom_name, name) as name, " +
            "password, " +
@@ -150,8 +155,11 @@
            "geoCoordSys," +
            "treeType," +
            "online," +
            "(SELECT count(0) FROM device_channel WHERE deviceId=de.deviceId) as channelCount  FROM device de")
    List<Device> getDevices();
            "(SELECT count(0) FROM device_channel WHERE deviceId=de.deviceId) as channelCount  FROM device de" +
            "<if test=\"online != null\"> where online=${online}</if>"+
            " </script>"
    )
    List<Device> getDevices(Boolean online);
    @Delete("DELETE FROM device WHERE deviceId=#{deviceId}")
    int del(String deviceId);
@@ -272,4 +280,6 @@
    @Select("select count(1) as total, sum(online) as online from device")
    ResourceBaceInfo getOverview();
    @Select("select * from device")
    List<Device> getAll();
}