|  |  | 
 |  |  |  | 
 |  |  |     @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp,  " + | 
 |  |  |             "            devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " + | 
 |  |  |             "            status) " + | 
 |  |  |             "            status, shareAllLiveStream) " + | 
 |  |  |             "            VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " + | 
 |  |  |             "            '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " + | 
 |  |  |             "            ${status})") | 
 |  |  |             "            ${status}, ${shareAllLiveStream})") | 
 |  |  |     int addParentPlatform(ParentPlatform parentPlatform); | 
 |  |  |  | 
 |  |  |     @Update("UPDATE parent_platform " + | 
 |  |  | 
 |  |  |             "characterSet=#{characterSet}, " + | 
 |  |  |             "ptz=#{ptz}, " + | 
 |  |  |             "rtcp=#{rtcp}, " + | 
 |  |  |             "status=#{status} " + | 
 |  |  |             "status=#{status}, " + | 
 |  |  |             "shareAllLiveStream=#{shareAllLiveStream} " + | 
 |  |  |             "WHERE id=#{id}") | 
 |  |  |     int updateParentPlatform(ParentPlatform parentPlatform); | 
 |  |  |  | 
 |  |  |     @Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}") | 
 |  |  |     int delParentPlatform(ParentPlatform parentPlatform); | 
 |  |  |  | 
 |  |  |     @Select("SELECT *,(" + | 
 |  |  |             "select sum(sum1) from ( " + | 
 |  |  |             "SELECT count(0) as sum1 FROM platform_gb_channel pc WHERE pc.platformId = pp.serverGBId " + | 
 |  |  |             "union all " + | 
 |  |  |             "SELECT count(0) as sum1 FROM platform_gb_stream pgs WHERE pgs.platformId = pp.serverGBId " + | 
 |  |  |             ") " + | 
 |  |  |             ") as channelCount " + | 
 |  |  |     @Select("SELECT *, ((SELECT count(0)\n" + | 
 |  |  |             "              FROM platform_gb_channel pc\n" + | 
 |  |  |             "              WHERE pc.platformId = pp.serverGBId)\n" + | 
 |  |  |             "              +\n" + | 
 |  |  |             "              (SELECT count(0)\n" + | 
 |  |  |             "              FROM platform_gb_stream pgs\n" + | 
 |  |  |             "              WHERE pgs.platformId = pp.serverGBId)) as channelCount\n" + | 
 |  |  |             "FROM parent_platform pp ") | 
 |  |  |     List<ParentPlatform> getParentPlatformList(); | 
 |  |  |  | 
 |  |  | 
 |  |  |     ParentPlatform getParentPlatById(int id); | 
 |  |  |  | 
 |  |  |     @Update("UPDATE parent_platform SET status=false" ) | 
 |  |  |     void outlineForAllParentPlatform(); | 
 |  |  |     int outlineForAllParentPlatform(); | 
 |  |  |  | 
 |  |  |     @Update("UPDATE parent_platform SET status=#{online} WHERE serverGBId=#{platformGbID}" ) | 
 |  |  |     int updateParentPlatformStatus(String platformGbID, boolean online); | 
 |  |  |  | 
 |  |  |     @Select("SELECT * FROM parent_platform WHERE shareAllLiveStream=true") | 
 |  |  |     List<ParentPlatform> selectAllAhareAllLiveStream(); | 
 |  |  | } |