|  |  |  | 
|---|
|  |  |  | "asMessageChannel," + | 
|---|
|  |  |  | "geoCoordSys," + | 
|---|
|  |  |  | "treeType," + | 
|---|
|  |  |  | "online" + | 
|---|
|  |  |  | "online," + | 
|---|
|  |  |  | "mediaServerId," + | 
|---|
|  |  |  | "(SELECT count(0) FROM device_channel WHERE deviceId=device.deviceId) as channelCount "+ | 
|---|
|  |  |  | " FROM device WHERE deviceId = #{deviceId}") | 
|---|
|  |  |  | Device getDeviceByDeviceId(String deviceId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | "geoCoordSys," + | 
|---|
|  |  |  | "treeType," + | 
|---|
|  |  |  | "online," + | 
|---|
|  |  |  | "mediaServerId," + | 
|---|
|  |  |  | "(SELECT count(0) FROM device_channel WHERE deviceId=de.deviceId) as channelCount  FROM device de" + | 
|---|
|  |  |  | "<if test=\"online != null\"> where online=${online}</if>"+ | 
|---|
|  |  |  | " </script>" | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Delete("DELETE FROM device WHERE deviceId=#{deviceId}") | 
|---|
|  |  |  | int del(String deviceId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Update("UPDATE device SET online=0") | 
|---|
|  |  |  | int outlineForAll(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Select("SELECT " + | 
|---|
|  |  |  | "deviceId, " + | 
|---|
|  |  |  | 
|---|
|  |  |  | "<if test=\"mediaServerId != null\">, mediaServerId=#{mediaServerId}</if>" + | 
|---|
|  |  |  | "WHERE deviceId=#{deviceId}"+ | 
|---|
|  |  |  | " </script>"}) | 
|---|
|  |  |  | int updateCustom(Device device); | 
|---|
|  |  |  | void updateCustom(Device device); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Insert("INSERT INTO device (" + | 
|---|
|  |  |  | "deviceId, " + | 
|---|
|  |  |  | 
|---|
|  |  |  | "asMessageChannel," + | 
|---|
|  |  |  | "geoCoordSys," + | 
|---|
|  |  |  | "treeType," + | 
|---|
|  |  |  | "online" + | 
|---|
|  |  |  | "online," + | 
|---|
|  |  |  | "mediaServerId" + | 
|---|
|  |  |  | ") VALUES (" + | 
|---|
|  |  |  | "#{deviceId}," + | 
|---|
|  |  |  | "#{name}," + | 
|---|
|  |  |  | 
|---|
|  |  |  | "#{asMessageChannel}," + | 
|---|
|  |  |  | "#{geoCoordSys}," + | 
|---|
|  |  |  | "#{treeType}," + | 
|---|
|  |  |  | "#{online}" + | 
|---|
|  |  |  | "#{online}," + | 
|---|
|  |  |  | "#{mediaServerId}" + | 
|---|
|  |  |  | ")") | 
|---|
|  |  |  | void addCustomDevice(Device device); | 
|---|
|  |  |  |  | 
|---|