|  |  | 
 |  |  | public interface ParentPlatformMapper { | 
 |  |  |  | 
 |  |  |     @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp,  " + | 
 |  |  |             "            devicePort, username, password, expires, keepTimeout, transport, characterSet, PTZEnable, rtcp, " + | 
 |  |  |             "            status) " + | 
 |  |  |             "            devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " + | 
 |  |  |             "            status, shareAllLiveStream, catalogId) " + | 
 |  |  |             "            VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " + | 
 |  |  |             "            '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${PTZEnable}, ${rtcp}, " + | 
 |  |  |             "            ${status})") | 
 |  |  |             "            '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " + | 
 |  |  |             "            ${status}, ${shareAllLiveStream}, #{catalogId})") | 
 |  |  |     int addParentPlatform(ParentPlatform parentPlatform); | 
 |  |  |  | 
 |  |  |     @Update("UPDATE parent_platform " + | 
 |  |  |             "SET enable=#{enable}, " + | 
 |  |  |             "name=#{name}," + | 
 |  |  |             "serverGBId=#{serverGBId}," + | 
 |  |  |             "deviceGBId=#{deviceGBId}," + | 
 |  |  |             "serverGBId=#{serverGBId}, " + | 
 |  |  |             "serverGBDomain=#{serverGBDomain}, " + | 
 |  |  |             "serverIP=#{serverIP}," + | 
 |  |  |             "serverPort=#{serverPort}, " + | 
 |  |  | 
 |  |  |             "keepTimeout=#{keepTimeout}, " + | 
 |  |  |             "transport=#{transport}, " + | 
 |  |  |             "characterSet=#{characterSet}, " + | 
 |  |  |             "PTZEnable=#{PTZEnable}, " + | 
 |  |  |             "ptz=#{ptz}, " + | 
 |  |  |             "rtcp=#{rtcp}, " + | 
 |  |  |             "status=#{status} " + | 
 |  |  |             "WHERE deviceGBId=#{deviceGBId}") | 
 |  |  |             "status=#{status}, " + | 
 |  |  |             "shareAllLiveStream=#{shareAllLiveStream}, " + | 
 |  |  |             "catalogId=#{catalogId} " + | 
 |  |  |             "WHERE id=#{id}") | 
 |  |  |     int updateParentPlatform(ParentPlatform parentPlatform); | 
 |  |  |  | 
 |  |  |     @Delete("DELETE FROM parent_platform WHERE deviceGBId=#{deviceGBId}") | 
 |  |  |     @Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}") | 
 |  |  |     int delParentPlatform(ParentPlatform parentPlatform); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Select("SELECT * FROM parent_platform") | 
 |  |  |     @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(); | 
 |  |  |  | 
 |  |  |     @Select("SELECT * FROM parent_platform WHERE deviceGBId=#{platformGbId}") | 
 |  |  |     ParentPlatform getParentPlatById(String platformGbId); | 
 |  |  |     @Select("SELECT * FROM parent_platform WHERE enable=#{enable}") | 
 |  |  |     List<ParentPlatform> getEnableParentPlatformList(boolean enable); | 
 |  |  |  | 
 |  |  |     @Select("SELECT * FROM parent_platform WHERE serverGBId=#{platformGbId}") | 
 |  |  |     ParentPlatform getParentPlatByServerGBId(String platformGbId); | 
 |  |  |  | 
 |  |  |     @Select("SELECT * FROM parent_platform WHERE id=#{id}") | 
 |  |  |     ParentPlatform getParentPlatById(int id); | 
 |  |  |  | 
 |  |  |     @Update("UPDATE parent_platform SET status=false" ) | 
 |  |  |     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(); | 
 |  |  |  | 
 |  |  |     @Update(value = {" <script>" + | 
 |  |  |             "UPDATE parent_platform " + | 
 |  |  |             "SET catalogId=#{catalogId}" + | 
 |  |  |             "WHERE serverGBId=#{platformId}"+ | 
 |  |  |             "</script>"}) | 
 |  |  |     int setDefaultCatalog(String platformId, String catalogId); | 
 |  |  | } |