|  |  | 
 |  |  |  | 
 |  |  | import com.genersoft.iot.vmp.gb28181.bean.Device; | 
 |  |  | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | 
 |  |  | import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | 
 |  |  | import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; | 
 |  |  | import org.apache.ibatis.annotations.Delete; | 
 |  |  | import org.apache.ibatis.annotations.Insert; | 
 |  |  | import org.apache.ibatis.annotations.Mapper; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Insert("<script> "+ | 
 |  |  |             "INSERT INTO platform_gb_channel (channelId, deviceId, platformId, deviceAndChannelId) VALUES" + | 
 |  |  |             "<foreach collection='channelReducesToAdd'  item='item' separator=','> ('${item.channelId}','${item.deviceId}', '${platformId}', '${item.deviceId}_${item.channelId}' )</foreach>" + | 
 |  |  |             "<foreach collection='channelReducesToAdd'  item='item' separator=','>" + | 
 |  |  |             " ('${item.channelId}','${item.deviceId}', '${platformId}', '${item.deviceId}_${item.channelId}' )" + | 
 |  |  |             "</foreach>" + | 
 |  |  |             "</script>") | 
 |  |  |     int addChannels(String platformId, List<ChannelReduce> channelReducesToAdd); | 
 |  |  |  | 
 |  |  | 
 |  |  |     int delChannelForGB(String platformId, List<ChannelReduce> channelReducesToDel); | 
 |  |  |  | 
 |  |  |     @Delete("<script> "+ | 
 |  |  |             "DELETE FROM platform_gb_channel WHERE deviceId='${deviceId}' " + | 
 |  |  |             "</script>") | 
 |  |  |     int delChannelForDeviceId(String deviceId); | 
 |  |  |  | 
 |  |  |     @Delete("<script> "+ | 
 |  |  |             "DELETE FROM platform_gb_channel WHERE platformId='${platformId}'"  + | 
 |  |  |             "</script>") | 
 |  |  |     int cleanChannelForGB(String platformId); |