From 54038486f4792dce478bca6698f3cd9b55d0ae90 Mon Sep 17 00:00:00 2001 From: chenzhangyue Date: Tue, 12 Sep 2023 20:23:14 +0800 Subject: [PATCH] generate @param --- .../vmp/storager/dao/DeviceAlarmMapper.java | 7 +-- .../vmp/storager/dao/DeviceChannelMapper.java | 43 ++++++++++--------- .../iot/vmp/storager/dao/DeviceMapper.java | 3 +- .../dao/DeviceMobilePositionMapper.java | 3 +- .../iot/vmp/storager/dao/GbStreamMapper.java | 19 ++++---- .../iot/vmp/storager/dao/LogMapper.java | 3 +- .../vmp/storager/dao/MediaServerMapper.java | 5 ++- .../storager/dao/ParentPlatformMapper.java | 7 +-- .../storager/dao/PlatformCatalogMapper.java | 17 ++++---- .../storager/dao/PlatformChannelMapper.java | 23 +++++----- .../storager/dao/PlatformGbStreamMapper.java | 16 +++---- .../vmp/storager/dao/StreamProxyMapper.java | 8 ++-- .../vmp/storager/dao/StreamPushMapper.java | 10 ++--- .../iot/vmp/storager/dao/UserMapper.java | 5 ++- 14 files changed, 90 insertions(+), 79 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java index 28a2e913..589e6f2a 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java @@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Repository; @@ -32,8 +33,8 @@ public interface DeviceAlarmMapper { " AND alarm_time <= #{endTime} " + " ORDER BY alarm_time ASC " + " "}) - List query(String deviceId, String alarmPriority, String alarmMethod, - String alarmType, String startTime, String endTime); + List query(@Param("deviceId") String deviceId, @Param("alarmPriority") String alarmPriority, @Param("alarmMethod") String alarmMethod, + @Param("alarmType") String alarmType, @Param("startTime") String startTime, @Param("endTime") String endTime); @Delete(" " ) - int clearAlarmBeforeTime(Integer id, List deviceIdList, String time); + int clearAlarmBeforeTime(@Param("id") Integer id, @Param("deviceIdList") List deviceIdList, @Param("time") String time); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java index d48b802d..1bdae76b 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java @@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend; import org.apache.ibatis.annotations.*; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @@ -82,7 +83,7 @@ public interface DeviceChannelMapper { " " + "ORDER BY dc.channel_id " + " "}) - List queryChannels(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, List channelIds); + List queryChannels(@Param("deviceId") String deviceId, @Param("parentChannelId") String parentChannelId, @Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel, @Param("online") Boolean online, @Param("channelIds") List channelIds); @Select(value = {" "}) - List queryChannelsWithDeviceInfo(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, List channelIds); + List queryChannelsWithDeviceInfo(@Param("deviceId") String deviceId, @Param("parentChannelId") String parentChannelId, @Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel, @Param("online") Boolean online, @Param("channelIds") List channelIds); @Select(value = {" "}) - List queryChannelsByDeviceIdWithStartAndLimit(String deviceId,List channelIds, String parentChannelId, String query, - Boolean hasSubChannel, Boolean online, int start, int limit); + List queryChannelsByDeviceIdWithStartAndLimit(@Param("deviceId") String deviceId, @Param("channelIds") List channelIds, @Param("parentChannelId") String parentChannelId, @Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel, @Param("online") Boolean online, @Param("start") int start, @Param("limit") int limit); @Select("SELECT * FROM wvp_device_channel WHERE device_id=#{deviceId} AND channel_id=#{channelId}") - DeviceChannel queryChannel(String deviceId, String channelId); + DeviceChannel queryChannel(@Param("deviceId") String deviceId,@Param("channelId") String channelId); @Delete("DELETE FROM wvp_device_channel WHERE device_id=#{deviceId}") - int cleanChannelsByDeviceId(String deviceId); + int cleanChannelsByDeviceId(@Param("deviceId") String deviceId); @Delete("DELETE FROM wvp_device_channel WHERE device_id=#{deviceId} AND channel_id=#{channelId}") - int del(String deviceId, String channelId); + int del(@Param("deviceId") String deviceId, @Param("channelId") String channelId); @Update(value = {"UPDATE wvp_device_channel SET stream_id=null WHERE device_id=#{deviceId} AND channel_id=#{channelId}"}) - void stopPlay(String deviceId, String channelId); + void stopPlay(@Param("deviceId") String deviceId, @Param("channelId") String channelId); @Update(value = {"UPDATE wvp_device_channel SET stream_id=#{streamId} WHERE device_id=#{deviceId} AND channel_id=#{channelId}"}) - void startPlay(String deviceId, String channelId, String streamId); + void startPlay(@Param("deviceId") String deviceId, @Param("channelId") String channelId, @Param("streamId") String streamId); + @Select(value = {" "}) - List queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, String catalogId); + List queryChannelListInAll(@Param("query") String query, @Param("online") Boolean online, @Param("hasSubChannel") Boolean hasSubChannel, @Param("platformId") String platformId, @Param("catalogId") String catalogId); @Select(value = {" ") - int batchAdd(List addChannels); + int batchAdd(@Param("addChannels") List addChannels); @Insert(""}) - int cleanChannelsNotInList(String deviceId, List channels); + int cleanChannelsNotInList(@Param("deviceId") String deviceId, @Param("channels") List channels); @Update(" update wvp_device_channel" + " set sub_count = (select *" + @@ -337,7 +338,7 @@ public interface DeviceChannelMapper { " where device_id = #{deviceId} and parent_id = #{channelId}) as temp)" + " where device_id = #{deviceId} " + " and channel_id = #{channelId}") - int updateChannelSubCount(String deviceId, String channelId); + int updateChannelSubCount(@Param("deviceId") String deviceId, @Param("channelId") String channelId); @Update(value = {" "}) - List getChannelsWithCivilCodeAndLength(String deviceId, String parentId, Integer length); + List getChannelsWithCivilCodeAndLength(@Param("deviceId") String deviceId, @Param("parentId") String parentId, @Param("length") Integer length); @Select(value = {" "}) - List getChannelsByCivilCode(String deviceId, String parentId); + List getChannelsByCivilCode(@Param("deviceId") String deviceId, @Param("parentId") String parentId); @Select("select min(length(channel_id)) as minLength " + "from wvp_device_channel " + @@ -389,7 +390,7 @@ public interface DeviceChannelMapper { List getChannelWithoutCivilCode(String deviceId); @Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}") - List getBusinessGroups(String deviceId, String typeCode); + List getBusinessGroups(@Param("deviceId") String deviceId, @Param("typeCode") String typeCode); @Select("select dc.id, dc.channel_id, dc.device_id, dc.name, dc.manufacture,dc.model,dc.owner, pc.civil_code,dc.block, " + " dc.address, '0' as parental,'0' as channel_type, pc.id as parent_id, dc.safety_way, dc.register_way,dc.cert_num, dc.certifiable, " + @@ -428,14 +429,14 @@ public interface DeviceChannelMapper { "DELETE FROM wvp_device_channel WHERE device_id=#{item.deviceId} AND channel_id=#{item.channelId}" + "" + ""}) - int batchDel(List deleteChannelList); + int batchDel(@Param("deleteChannelList") List deleteChannelList); @Update({""}) - int batchOnline(List channels); + int batchOnline(@Param("channels") List channels); @Update({""}) - List getSubChannelsByDeviceId(String deviceId, String parentId, boolean onlyCatalog); + List getSubChannelsByDeviceId(@Param("deviceId") String deviceId, @Param("parentId") String parentId, @Param("onlyCatalog") boolean onlyCatalog); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java index 96773fe9..30ffd2bb 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.storager.dao; import com.genersoft.iot.vmp.gb28181.bean.Device; import org.apache.ibatis.annotations.*; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @@ -229,7 +230,7 @@ public interface DeviceMapper { "geo_coord_sys,"+ "on_line"+ " FROM wvp_device WHERE ip = #{host} AND port=#{port}") - Device getDeviceByHostAndPort(String host, int port); + Device getDeviceByHostAndPort(@Param("host") String host, @Param("port") int port); @Update(value = {" "}) - List queryPositionByDeviceIdAndTime(String deviceId, String channelId, String startTime, String endTime); + List queryPositionByDeviceIdAndTime(@Param("deviceId") String deviceId, @Param("channelId") String channelId, @Param("startTime") String startTime, @Param("endTime") String endTime); @Select("SELECT * FROM wvp_device_mobile_position WHERE device_id = #{deviceId}" + " ORDER BY time DESC LIMIT 1") diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java index e313acea..f11cc663 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java @@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; import com.genersoft.iot.vmp.service.bean.GPSMsgInfo; import org.apache.ibatis.annotations.*; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @@ -47,7 +48,7 @@ public interface GbStreamMapper { int update(GbStream gbStream); @Delete("DELETE FROM wvp_gb_stream WHERE app=#{app} AND stream=#{stream}") - int del(String app, String stream); + int del(@Param("app") String app, @Param("stream") String stream); @Select("") - List selectAll(String platformId, String catalogId, String query, String mediaServerId); + List selectAll(@Param("platformId") String platformId, @Param("catalogId") String catalogId, @Param("query") String query, @Param("mediaServerId") String mediaServerId); @Select("SELECT * FROM wvp_gb_stream WHERE app=#{app} AND stream=#{stream}") - GbStream selectOne(String app, String stream); + GbStream selectOne(@Param("app") String app, @Param("stream") String stream); @Select("SELECT * FROM wvp_gb_stream WHERE gb_id=#{gbId}") List selectByGBId(String gbId); @@ -72,7 +73,7 @@ public interface GbStreamMapper { @Select("SELECT gs.*, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id FROM wvp_gb_stream gs " + "LEFT JOIN wvp_platform_gb_stream pgs ON gs.gb_stream_id = pgs.gb_stream_id " + "WHERE gs.gb_id = #{gbId} AND pgs.platform_id = #{platformId}") - GbStream queryStreamInPlatform(String platformId, String gbId); + GbStream queryStreamInPlatform(@Param("platformId") String platformId, @Param("gbId") String gbId); @Select("") - List queryGbStreamListInPlatform(String platformId, boolean usPushingAsStatus); + List queryGbStreamListInPlatform(String platformId, @Param("usPushingAsStatus") boolean usPushingAsStatus); @Select("SELECT gs.* FROM wvp_gb_stream gs left join wvp_platform_gb_stream pgs " + @@ -98,7 +99,7 @@ public interface GbStreamMapper { List queryStreamNotInPlatform(); @Delete("DELETE FROM wvp_gb_stream WHERE stream_type=#{type} AND gb_id=NULL AND media_server_id=#{mediaServerId}") - void deleteWithoutGBId(String type, String mediaServerId); + void deleteWithoutGBId(@Param("type") String type, @Param("mediaServerId") String mediaServerId); @Delete("") @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gb_stream_id") - void batchAdd(List subList); + void batchAdd(@Param("subList") List subList); @Update({""}) - List query(String query, String type, String startTime, String endTime); + List query(@Param("query") String query, @Param("type") String type, @Param("startTime") String startTime, @Param("endTime") String endTime); @Delete("DELETE FROM wvp_log") int clear(); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/MediaServerMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/MediaServerMapper.java index cdc303dd..13d53658 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/MediaServerMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/MediaServerMapper.java @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.storager.dao; import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; import org.apache.ibatis.annotations.*; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @@ -119,13 +120,13 @@ public interface MediaServerMapper { void delOne(String id); @Select("DELETE FROM wvp_media_server WHERE ip=#{host} and http_port=#{port}") - void delOneByIPAndPort(String host, int port); + void delOneByIPAndPort(@Param("host") String host, @Param("port") int port); @Delete("DELETE FROM wvp_media_server WHERE default_server=true") int delDefault(); @Select("SELECT * FROM wvp_media_server WHERE ip=#{host} and http_port=#{port}") - MediaServerItem queryOneByHostAndPort(String host, int port); + MediaServerItem queryOneByHostAndPort(@Param("host") String host, @Param("port") int port); @Select("SELECT * FROM wvp_media_server WHERE default_server=true") MediaServerItem queryDefault(); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java index 386d7dc0..10958a87 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.storager.dao; import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo; import org.apache.ibatis.annotations.*; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @@ -84,17 +85,17 @@ public interface ParentPlatformMapper { int outlineForAllParentPlatform(); @Update("UPDATE wvp_platform SET status=#{online} WHERE server_gb_id=#{platformGbID}" ) - int updateParentPlatformStatus(String platformGbID, boolean online); + int updateParentPlatformStatus(@Param("platformGbID") String platformGbID, @Param("online") boolean online); @Update(value = {" "}) - int setDefaultCatalog(String platformId, String catalogId, String updateTime); + int setDefaultCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId, @Param("updateTime") String updateTime); @Select("select 'channel' as name, count(pgc.platform_id) count from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id where pgc.platform_id=#{platform_id} and dc.channel_id =#{gbId} " + "union " + "select 'stream' as name, count(pgs.platform_id) count from wvp_platform_gb_stream pgs left join wvp_gb_stream gs on pgs.gb_stream_id = gs.gb_stream_id where pgs.platform_id=#{platform_id} and gs.gb_id =#{gbId}") - List getChannelSource(String platform_id, String gbId); + List getChannelSource(@Param("platform_id") String platform_id, @Param("gbId") String gbId); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java index 3cb4776b..edd34e5d 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.storager.dao; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog; import org.apache.ibatis.annotations.*; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @@ -17,37 +18,37 @@ public interface PlatformCatalogMapper { int add(PlatformCatalog platformCatalog); @Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}") - int del(String platformId, String id); + int del(@Param("platformId") String platformId, @Param("id") String id); @Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}") - int delByPlatformId(String platformId); + int delByPlatformId(@Param("platformId") String platformId); @Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " + "left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " + "WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " + "group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id") - List selectByParentId(String platformId, String parentId); + List selectByParentId(@Param("platformId") String platformId, @Param("parentId") String parentId); @Update(value = {" "}) - int update(PlatformCatalog platformCatalog); + int update(@Param("platformCatalog") PlatformCatalog platformCatalog); @Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}") - List selectByPlatForm(String platformId); + List selectByPlatForm(@Param("platformId") String platformId); @Select("SELECT pc.* FROM wvp_platform_catalog pc WHERE pc.id = (SELECT pp.catalog_id from wvp_platform pp WHERE pp.server_gb_id=#{platformId})") - PlatformCatalog selectDefaultByPlatFormId(String platformId); + PlatformCatalog selectDefaultByPlatFormId(@Param("platformId") String platformId); @Select("SELECT pc.id as channel_id, pc.name, pc.civil_code, pc.business_group_id,'1' as parental, pc.parent_id " + " from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}") - List queryCatalogInPlatform(String platformId); + List queryCatalogInPlatform(@Param("platformId") String platformId); @Select("SELECT *, " + "(SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count " + " from wvp_platform_catalog pc " + " WHERE pc.id=#{id} and pc.platform_id=#{platformId}") - PlatformCatalog selectByPlatFormAndCatalogId(String platformId, String id); + PlatformCatalog selectByPlatFormAndCatalogId(@Param("platformId") String platformId, @Param("id") String id); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java index 7a749cbd..38263506 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java @@ -8,6 +8,7 @@ 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; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Repository; @@ -24,7 +25,7 @@ public interface PlatformChannelMapper { "SELECT device_channel_id from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" + " #{item.id}" + "") - List findChannelRelatedPlatform(String platformId, List channelReduces); + List findChannelRelatedPlatform(@Param("platformId") String platformId, @Param("channelReduces") List channelReduces); @Insert("") - int addChannels(String platformId, List channelReducesToAdd); + int addChannels(@Param("platformId") String platformId, @Param("channelReducesToAdd") List channelReducesToAdd); @Delete("") - int delChannelForGB(String platformId, List channelReducesToDel); + int delChannelForGB(@Param("platformId") String platformId, @Param("channelReducesToDel") List channelReducesToDel); @Delete("") - int delByCatalogId(String platformId, String id); + int delByCatalogId(@Param("platformId") String platformId, @Param("id") String id); @Delete(" ") - List queryPlatFormListForGBWithGBId(String channelId, List platforms); + List queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List platforms); @Delete("") - int delChannelForGBByCatalogId(String platformId, String catalogId); + int delChannelForGBByCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId); @Select("select dc.channel_id dc.device_id,dc.name,d.manufacturer,d.model,d.firmware\n" + "from wvp_platform_gb_channel pgc\n" + " left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" + " left join wvp_device d on dc.device_id = d.device_id\n" + "where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}") - List queryDeviceInfoByPlatformIdAndChannelId(String platformId, String channelId); + List queryDeviceInfoByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId); @Select("SELECT pgc.platform_id from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id='${channelId}'") List queryParentPlatformByChannelId(String channelId); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java index 40640db7..d6543050 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java @@ -32,7 +32,7 @@ public interface PlatformGbStreamMapper { int batchAdd(List streamPushItems); @Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select gb_stream_id from wvp_gb_stream where app=#{app} AND stream=#{stream})") - int delByAppAndStream(String app, String stream); + int delByAppAndStream(@Param("app") String app, @Param("stream") String stream); @Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}") int delByPlatformId(String platformId); @@ -46,26 +46,26 @@ public interface PlatformGbStreamMapper { "WHERE " + "gs.app =#{app} " + "AND gs.stream =#{stream} ") - List selectByAppAndStream(String app, String stream); + List selectByAppAndStream(@Param("app") String app, @Param("stream") String stream); @Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " + "LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " + "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}") - StreamProxyItem selectOne(String app, String stream, String platformId); + StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId); @Select("select gs.* \n" + "from wvp_gb_stream gs\n" + " left join wvp_platform_gb_stream pgs\n" + " on gs.gb_stream_id = pgs.gb_stream_id\n" + "where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}") - List queryChannelInParentPlatformAndCatalog(String platformId, String catalogId); + List queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); @Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" + "from wvp_gb_stream gs\n" + " left join wvp_platform_gb_stream pgs\n" + " on gs.gb_stream_id = pgs.gb_stream_id\n" + "where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}") - List queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId); + List queryChannelInParentPlatformAndCatalogForCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); @Select(" ") - List queryPlatFormListForGBWithGBId(String app, String stream, List platforms); + List queryPlatFormListForGBWithGBId(@Param("app") String app, @Param("stream") String stream, @Param("platforms") List platforms); @Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select id from wvp_gb_stream where app=#{app} AND stream=#{stream}) AND platform_id=#{platformId}") int delByAppAndStreamAndPlatform(String app, String stream, String platformId); @@ -101,8 +101,8 @@ public interface PlatformGbStreamMapper { "#{item.gbStreamId} " + "" + "") - void delByAppAndStreamsByPlatformId(List gbStreams, String platformId); + void delByAppAndStreamsByPlatformId(@Param("gbStreams") List gbStreams, @Param("platformId") String platformId); @Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId} and catalog_id=#{catalogId}") - int delByPlatformAndCatalogId(String platformId, String catalogId); + int delByPlatformAndCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java index a5a80c47..34a0673e 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java @@ -49,12 +49,12 @@ public interface StreamProxyMapper { List selectForEnable(boolean enable); @Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.app=#{app} AND st.stream=#{stream} order by st.create_time desc") - StreamProxyItem selectOne(String app, String stream); + StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream); @Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st " + "LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " + "WHERE st.enable=#{enable} and st.media_server_id= #{id} order by st.create_time desc") - List selectForEnableInMediaServer(String id, boolean enable); + List selectForEnableInMediaServer( @Param("id") String id, @Param("enable") boolean enable); @Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st " + "LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " + @@ -64,12 +64,12 @@ public interface StreamProxyMapper { @Update("UPDATE wvp_stream_proxy " + "SET status=#{status} " + "WHERE media_server_id=#{mediaServerId}") - void updateStatusByMediaServerId(String mediaServerId, boolean status); + void updateStatusByMediaServerId(@Param("mediaServerId") String mediaServerId, @Param("status") boolean status); @Update("UPDATE wvp_stream_proxy " + "SET status=#{status} " + "WHERE app=#{app} AND stream=#{stream}") - int updateStatus(String app, String stream, boolean status); + int updateStatus(@Param("app") String app, @Param("stream") String stream, @Param("status") boolean status); @Delete("DELETE FROM wvp_stream_proxy WHERE enable_remove_none_reader=true AND media_server_id=#{mediaServerId}") void deleteAutoRemoveItemByMediaServerId(String mediaServerId); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java index 4efc058d..be0924ab 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java @@ -79,13 +79,13 @@ public interface StreamPushMapper { " AND st.media_server_id=#{mediaServerId} " + "order by st.create_time desc" + " "}) - List selectAllForList(String query, Boolean pushing, String mediaServerId); + List selectAllForList(@Param("query") String query, @Param("pushing") Boolean pushing, @Param("mediaServerId") String mediaServerId); @Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream order by st.create_time desc") List selectAll(); @Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream WHERE st.app=#{app} AND st.stream=#{stream}") - StreamPushItem selectOne(String app, String stream); + StreamPushItem selectOne(@Param("app") String app, @Param("stream") String stream); @Insert("