|  |  | 
 |  |  | import org.springframework.stereotype.Repository; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  |  | 
 |  |  | @Mapper | 
 |  |  | @Repository | 
 |  |  | public interface GbStreamMapper { | 
 |  |  |  | 
 |  |  |     @Insert("REPLACE INTO wvp_gb_stream (app, stream, gb_id, name, " + | 
 |  |  |     @Insert("INSERT INTO wvp_gb_stream (app, stream, gb_id, name, " + | 
 |  |  |             "longitude, latitude, stream_type,media_server_id,create_time) VALUES" + | 
 |  |  |             "(#{app}, #{stream}, #{gbId}, #{name}, " + | 
 |  |  |             "#{longitude}, #{latitude}, #{streamType}, " + | 
 |  |  |             "#{mediaServerId}, #{createTime})") | 
 |  |  |     @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId") | 
 |  |  |     @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gb_stream_id") | 
 |  |  |     int add(GbStream gbStream); | 
 |  |  |  | 
 |  |  |     @Update("UPDATE wvp_gb_stream " + | 
 |  |  | 
 |  |  |                 " <foreach collection='list' item='item' index='index' separator=';'>"+ | 
 |  |  |                     "UPDATE wvp_gb_stream " + | 
 |  |  |                     " SET name=#{item.name},"+ | 
 |  |  |                     " gb_id=#{item.gb_id}"+ | 
 |  |  |                     " gb_id=#{item.gbId}"+ | 
 |  |  |                     " WHERE app=#{item.app} and stream=#{item.stream}"+ | 
 |  |  |                 "</foreach>"+ | 
 |  |  |             "</script>") | 
 |  |  | 
 |  |  |     @Select("SELECT status FROM wvp_stream_push WHERE app=#{app} AND stream=#{stream}") | 
 |  |  |     Boolean selectStatusForPush(@Param("app") String app, @Param("stream") String stream); | 
 |  |  |  | 
 |  |  |     @MapKey("gbId") | 
 |  |  |     @Select("SELECT * from wvp_gb_stream") | 
 |  |  |     Map<String, GbStream> getAllGBId(); | 
 |  |  | } |