|
@@ -3,10 +3,7 @@ package com.zd.iot.vmp.storager.dao;
|
|
|
import com.zd.iot.vmp.gb28181.bean.Device;
|
|
import com.zd.iot.vmp.gb28181.bean.Device;
|
|
|
import com.zd.iot.vmp.gb28181.bean.DeviceChannel;
|
|
import com.zd.iot.vmp.gb28181.bean.DeviceChannel;
|
|
|
import com.zd.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
|
import com.zd.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;
|
|
|
|
|
-import org.apache.ibatis.annotations.Select;
|
|
|
|
|
|
|
+import org.apache.ibatis.annotations.*;
|
|
|
import org.springframework.stereotype.Repository;
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -22,13 +19,13 @@ public interface PlatformChannelMapper {
|
|
|
"SELECT deviceAndChannelId FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" +
|
|
"SELECT deviceAndChannelId FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" +
|
|
|
"<foreach collection='deviceAndChannelIds' open='(' item='id_' separator=',' close=')'> '${id_}'</foreach> ORDER BY deviceAndChannelId ASC" +
|
|
"<foreach collection='deviceAndChannelIds' open='(' item='id_' separator=',' close=')'> '${id_}'</foreach> ORDER BY deviceAndChannelId ASC" +
|
|
|
"</script>")
|
|
"</script>")
|
|
|
- List<String> findChannelRelatedPlatform(String platformId, List<String> deviceAndChannelIds);
|
|
|
|
|
|
|
+ List<String> findChannelRelatedPlatform(@Param("platformId") String platformId,@Param("deviceAndChannelIds") List<String> deviceAndChannelIds);
|
|
|
|
|
|
|
|
@Insert("<script> "+
|
|
@Insert("<script> "+
|
|
|
"INSERT INTO platform_gb_channel (channelId, deviceId, platformId, deviceAndChannelId) VALUES" +
|
|
"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>")
|
|
"</script>")
|
|
|
- int addChannels(String platformId, List<ChannelReduce> channelReducesToAdd);
|
|
|
|
|
|
|
+ int addChannels(@Param("platformId") String platformId, @Param("channelReducesToAdd") List<ChannelReduce> channelReducesToAdd);
|
|
|
|
|
|
|
|
|
|
|
|
|
@Delete("<script> "+
|
|
@Delete("<script> "+
|
|
@@ -50,8 +47,8 @@ public interface PlatformChannelMapper {
|
|
|
|
|
|
|
|
@Select("SELECT * FROM device_channel WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE " +
|
|
@Select("SELECT * FROM device_channel WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE " +
|
|
|
"platformId='${platformId}' AND channelId='${channelId}' ) AND channelId='${channelId}'")
|
|
"platformId='${platformId}' AND channelId='${channelId}' ) AND channelId='${channelId}'")
|
|
|
- DeviceChannel queryChannelInParentPlatform(String platformId, String channelId);
|
|
|
|
|
|
|
+ DeviceChannel queryChannelInParentPlatform(@Param("platformId") String platformId,@Param("channelId") String channelId);
|
|
|
|
|
|
|
|
@Select("SELECT * FROM device WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE platformId='${platformId}' AND channelId='${channelId}')")
|
|
@Select("SELECT * FROM device WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE platformId='${platformId}' AND channelId='${channelId}')")
|
|
|
- Device queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
|
|
|
|
|
|
|
+ Device queryVideoDeviceByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
|
|
}
|
|
}
|