|  |  | 
 |  |  |  | 
 |  |  |     @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp,  " + | 
 |  |  |             "            devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " + | 
 |  |  |             "            status, shareAllLiveStream, catalogId) " + | 
 |  |  |             "            status, startOfflinePush, catalogId, administrativeDivision, catalogGroup, createTime, updateTime, treeType) " + | 
 |  |  |             "            VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " + | 
 |  |  |             "            '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " + | 
 |  |  |             "            ${status}, ${shareAllLiveStream}, #{catalogId})") | 
 |  |  |             "            ${status},  ${startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{treeType})") | 
 |  |  |     int addParentPlatform(ParentPlatform parentPlatform); | 
 |  |  |  | 
 |  |  |     @Update("UPDATE parent_platform " + | 
 |  |  | 
 |  |  |             "ptz=#{ptz}, " + | 
 |  |  |             "rtcp=#{rtcp}, " + | 
 |  |  |             "status=#{status}, " + | 
 |  |  |             "shareAllLiveStream=#{shareAllLiveStream}, " + | 
 |  |  |             "startOfflinePush=${startOfflinePush}, " + | 
 |  |  |             "catalogGroup=#{catalogGroup}, " + | 
 |  |  |             "administrativeDivision=#{administrativeDivision}, " + | 
 |  |  |             "createTime=#{createTime}, " + | 
 |  |  |             "updateTime=#{updateTime}, " + | 
 |  |  |             "treeType=#{treeType}, " + | 
 |  |  |             "catalogId=#{catalogId} " + | 
 |  |  |             "WHERE id=#{id}") | 
 |  |  |     int updateParentPlatform(ParentPlatform parentPlatform); | 
 |  |  | 
 |  |  |     @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}" + | 
 |  |  |             "SET catalogId=#{catalogId}, updateTime=#{updateTime}" + | 
 |  |  |             "WHERE serverGBId=#{platformId}"+ | 
 |  |  |             "</script>"}) | 
 |  |  |     int setDefaultCatalog(String platformId, String catalogId); | 
 |  |  |     int setDefaultCatalog(String platformId, String catalogId, String updateTime); | 
 |  |  |  | 
 |  |  |     @Select("select 'channel' as name, count(pgc.platformId) count from platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId where  pgc.platformId=#{platformId} and dc.channelId =#{gbId} " + | 
 |  |  |             "union " + |