648540858
2023-01-13 dea44dcd78418ed3e7f191a73cee2b81a7a0019f
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
@@ -24,6 +24,8 @@
            "transport," +
            "streamMode," +
            "ip," +
            "sdpIp," +
            "localIp," +
            "port," +
            "hostAddress," +
            "expires," +
@@ -52,11 +54,14 @@
                "transport," +
                "streamMode," +
                "ip," +
                "sdpIp," +
                "localIp," +
                "port," +
                "hostAddress," +
                "expires," +
                "registerTime," +
                "keepaliveTime," +
                "keepaliveIntervalTime," +
                "createTime," +
                "updateTime," +
                "charset," +
@@ -77,11 +82,14 @@
                "#{transport}," +
                "#{streamMode}," +
                "#{ip}," +
                "#{sdpIp}," +
                "#{localIp}," +
                "#{port}," +
                "#{hostAddress}," +
                "#{expires}," +
                "#{registerTime}," +
                "#{keepaliveTime}," +
                "#{keepaliveIntervalTime}," +
                "#{createTime}," +
                "#{updateTime}," +
                "#{charset}," +
@@ -98,24 +106,28 @@
    @Update(value = {" <script>" +
                "UPDATE device " +
                "SET updateTime='${updateTime}'" +
                "<if test=\"name != null\">, name='${name}'</if>" +
                "<if test=\"manufacturer != null\">, manufacturer='${manufacturer}'</if>" +
                "<if test=\"model != null\">, model='${model}'</if>" +
                "<if test=\"firmware != null\">, firmware='${firmware}'</if>" +
                "<if test=\"transport != null\">, transport='${transport}'</if>" +
                "<if test=\"ip != null\">, ip='${ip}'</if>" +
                "<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}'"+
                "SET updateTime=#{updateTime}" +
                "<if test=\"name != null\">, name=#{name}</if>" +
                "<if test=\"manufacturer != null\">, manufacturer=#{manufacturer}</if>" +
                "<if test=\"model != null\">, model=#{model}</if>" +
                "<if test=\"firmware != null\">, firmware=#{firmware}</if>" +
                "<if test=\"transport != null\">, transport=#{transport}</if>" +
                "<if test=\"ip != null\">, ip=#{ip}</if>" +
                "<if test=\"localIp != null\">, localIp=#{localIp}</if>" +
                "<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=\"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, " +
@@ -125,6 +137,8 @@
            "transport," +
            "streamMode," +
            "ip," +
            "sdpIp," +
            "localIp," +
            "port," +
            "hostAddress," +
            "expires," +
@@ -141,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);
@@ -160,6 +177,8 @@
            "transport," +
            "streamMode," +
            "ip," +
            "sdpIp," +
            "localIp," +
            "port," +
            "hostAddress," +
            "expires," +
@@ -188,6 +207,8 @@
            "transport," +
            "streamMode," +
            "ip," +
            "sdpIp," +
            "localIp," +
            "port," +
            "hostAddress," +
            "expires," +
@@ -204,27 +225,28 @@
            "geoCoordSys," +
            "treeType," +
            "online" +
            " FROM device WHERE ip = #{host} AND port=${port}")
            " FROM device WHERE ip = #{host} AND port=#{port}")
    Device getDeviceByHostAndPort(String host, int port);
    @Update(value = {" <script>" +
            "UPDATE device " +
            "SET updateTime='${updateTime}'" +
            "<if test=\"name != null\">, custom_name='${name}'</if>" +
            "<if test=\"password != null\">, password='${password}'</if>" +
            "<if test=\"streamMode != null\">, streamMode='${streamMode}'</if>" +
            "<if test=\"ip != null\">, ip='${ip}'</if>" +
            "<if test=\"port != null\">, port=${port}</if>" +
            "<if test=\"charset != null\">, charset='${charset}'</if>" +
            "<if test=\"subscribeCycleForCatalog != null\">, subscribeCycleForCatalog=${subscribeCycleForCatalog}</if>" +
            "<if test=\"subscribeCycleForMobilePosition != null\">, subscribeCycleForMobilePosition=${subscribeCycleForMobilePosition}</if>" +
            "<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=${mobilePositionSubmissionInterval}</if>" +
            "<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=${subscribeCycleForAlarm}</if>" +
            "<if test=\"ssrcCheck != null\">, ssrcCheck=${ssrcCheck}</if>" +
            "SET updateTime=#{updateTime}" +
            "<if test=\"name != null\">, custom_name=#{name}</if>" +
            "<if test=\"password != null\">, password=#{password}</if>" +
            "<if test=\"streamMode != null\">, streamMode=#{streamMode}</if>" +
            "<if test=\"ip != null\">, ip=#{ip}</if>" +
            "<if test=\"sdpIp != null\">, sdpIp=#{sdpIp}</if>" +
            "<if test=\"port != null\">, port=#{port}</if>" +
            "<if test=\"charset != null\">, charset=#{charset}</if>" +
            "<if test=\"subscribeCycleForCatalog != null\">, subscribeCycleForCatalog=#{subscribeCycleForCatalog}</if>" +
            "<if test=\"subscribeCycleForMobilePosition != null\">, subscribeCycleForMobilePosition=#{subscribeCycleForMobilePosition}</if>" +
            "<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=#{mobilePositionSubmissionInterval}</if>" +
            "<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=#{subscribeCycleForAlarm}</if>" +
            "<if test=\"ssrcCheck != null\">, ssrcCheck=#{ssrcCheck}</if>" +
            "<if test=\"geoCoordSys != null\">, geoCoordSys=#{geoCoordSys}</if>" +
            "<if test=\"treeType != null\">, treeType=#{treeType}</if>" +
            "<if test=\"mediaServerId != null\">, mediaServerId=#{mediaServerId}</if>" +
            "WHERE deviceId='${deviceId}'"+
            "WHERE deviceId=#{deviceId}"+
            " </script>"})
    int updateCustom(Device device);
@@ -232,6 +254,7 @@
            "deviceId, " +
            "custom_name, " +
            "password, " +
            "sdpIp, " +
            "createTime," +
            "updateTime," +
            "charset," +
@@ -243,6 +266,7 @@
            "#{deviceId}," +
            "#{name}," +
            "#{password}," +
            "#{sdpIp}," +
            "#{createTime}," +
            "#{updateTime}," +
            "#{charset}," +