generate @param

pull/1071/head
chenzhangyue 2023-09-12 20:23:14 +08:00
parent f57ed350b3
commit 54038486f4
14 changed files with 90 additions and 79 deletions

View File

@ -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 {
" <if test=\"endTime != null\" > AND alarm_time &lt;= #{endTime} </if>" +
" ORDER BY alarm_time ASC " +
" </script>"})
List<DeviceAlarm> query(String deviceId, String alarmPriority, String alarmMethod,
String alarmType, String startTime, String endTime);
List<DeviceAlarm> 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(" <script>" +
@ -45,5 +46,5 @@ public interface DeviceAlarmMapper {
" <if test=\"id != null\" > AND id = #{id}</if>" +
" </script>"
)
int clearAlarmBeforeTime(Integer id, List<String> deviceIdList, String time);
int clearAlarmBeforeTime(@Param("id") Integer id, @Param("deviceIdList") List<String> deviceIdList, @Param("time") String time);
}

View File

@ -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 {
"</foreach> </if>" +
"ORDER BY dc.channel_id " +
" </script>"})
List<DeviceChannel> queryChannels(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, List<String> channelIds);
List<DeviceChannel> queryChannels(@Param("deviceId") String deviceId, @Param("parentChannelId") String parentChannelId, @Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel, @Param("online") Boolean online, @Param("channelIds") List<String> channelIds);
@Select(value = {" <script>" +
"SELECT " +
@ -105,7 +106,7 @@ public interface DeviceChannelMapper {
"</foreach> </if>" +
"ORDER BY dc.channel_id ASC" +
" </script>"})
List<DeviceChannelExtend> queryChannelsWithDeviceInfo(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, List<String> channelIds);
List<DeviceChannelExtend> queryChannelsWithDeviceInfo(@Param("deviceId") String deviceId, @Param("parentChannelId") String parentChannelId, @Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel, @Param("online") Boolean online, @Param("channelIds") List<String> channelIds);
@Select(value = {" <script>" +
@ -130,23 +131,23 @@ public interface DeviceChannelMapper {
"ORDER BY dc.channel_id ASC " +
"Limit #{limit} OFFSET #{start}" +
" </script>"})
List<DeviceChannelExtend> queryChannelsByDeviceIdWithStartAndLimit(String deviceId,List<String> channelIds, String parentChannelId, String query,
Boolean hasSubChannel, Boolean online, int start, int limit);
List<DeviceChannelExtend> queryChannelsByDeviceIdWithStartAndLimit(@Param("deviceId") String deviceId, @Param("channelIds") List<String> 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 = {" <script>" +
"SELECT " +
@ -172,7 +173,7 @@ public interface DeviceChannelMapper {
" <if test='catalogId != null ' > AND pgc.platform_id = #{platformId} and pgc.catalog_id=#{catalogId} </if> " +
" ORDER BY dc.device_id, dc.channel_id ASC" +
" </script>"})
List<ChannelReduce> queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, String catalogId);
List<ChannelReduce> queryChannelListInAll(@Param("query") String query, @Param("online") Boolean online, @Param("hasSubChannel") Boolean hasSubChannel, @Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select(value = {" <script>" +
"SELECT " +
@ -191,7 +192,7 @@ public interface DeviceChannelMapper {
List<DeviceChannel> queryChannelByChannelId( String channelId);
@Update(value = {"UPDATE wvp_device_channel SET status=false WHERE device_id=#{deviceId} AND channel_id=#{channelId}"})
void offline(String deviceId, String channelId);
void offline(@Param("deviceId") String deviceId, @Param("channelId") String channelId);
@Update(value = {"UPDATE wvp_device_channel SET status=false WHERE device_id=#{deviceId}"})
void offlineByDeviceId(String deviceId);
@ -214,7 +215,7 @@ public interface DeviceChannelMapper {
"#{item.businessGroupId}, #{item.gpsTime}) " +
"</foreach> " +
"</script>")
int batchAdd(List<DeviceChannel> addChannels);
int batchAdd(@Param("addChannels") List<DeviceChannel> addChannels);
@Insert("<script> " +
@ -271,7 +272,7 @@ public interface DeviceChannelMapper {
int batchAddOrUpdate(List<DeviceChannel> addChannels);
@Update(value = {"UPDATE wvp_device_channel SET status=true WHERE device_id=#{deviceId} AND channel_id=#{channelId}"})
void online(String deviceId, String channelId);
void online(@Param("deviceId") String deviceId, @Param("channelId") String channelId);
@Update({"<script>" +
"<foreach collection='updateChannels' item='item' separator=';'>" +
@ -328,7 +329,7 @@ public interface DeviceChannelMapper {
" AND channel_id NOT IN " +
"<foreach collection='channels' item='item' open='(' separator=',' close=')' > #{item.channelId}</foreach>" +
" </script>"})
int cleanChannelsNotInList(String deviceId, List<DeviceChannel> channels);
int cleanChannelsNotInList(@Param("deviceId") String deviceId, @Param("channels") List<DeviceChannel> 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 = {" <script>" +
"UPDATE wvp_device_channel " +
@ -370,14 +371,14 @@ public interface DeviceChannelMapper {
" <if test='parentId == null and length == null' > and parent_id= #{parentId} </if>" +
" <if test='parentId != null and length == null' > and parent_id= #{parentId} or left(channel_id, LENGTH(#{parentId})) = #{parentId} </if>" +
" </script>"})
List<DeviceChannel> getChannelsWithCivilCodeAndLength(String deviceId, String parentId, Integer length);
List<DeviceChannel> getChannelsWithCivilCodeAndLength(@Param("deviceId") String deviceId, @Param("parentId") String parentId, @Param("length") Integer length);
@Select(value = {" <script>" +
"select * " +
"from wvp_device_channel " +
"where device_id=#{deviceId} and length(channel_id)>14 and civil_code=#{parentId}" +
" </script>"})
List<DeviceChannel> getChannelsByCivilCode(String deviceId, String parentId);
List<DeviceChannel> 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<DeviceChannel> getChannelWithoutCivilCode(String deviceId);
@Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}")
List<DeviceChannel> getBusinessGroups(String deviceId, String typeCode);
List<DeviceChannel> 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}" +
"</foreach>" +
"</script>"})
int batchDel(List<DeviceChannel> deleteChannelList);
int batchDel(@Param("deleteChannelList") List<DeviceChannel> deleteChannelList);
@Update({"<script>" +
"<foreach collection='channels' item='item' separator=';'>" +
"UPDATE wvp_device_channel SET status=true WHERE device_id=#{item.deviceId} AND channel_id=#{item.channelId}" +
"</foreach>" +
"</script>"})
int batchOnline(List<DeviceChannel> channels);
int batchOnline(@Param("channels") List<DeviceChannel> channels);
@Update({"<script>" +
"<foreach collection='channels' item='item' separator=';'>" +
@ -463,6 +464,6 @@ public interface DeviceChannelMapper {
" <if test='parentId == null or parentId == deviceId'> and parent_id is null or parent_id = #{deviceId}</if>" +
" <if test='onlyCatalog == true '> and parental = 1 </if>" +
" </script>"})
List<DeviceChannel> getSubChannelsByDeviceId(String deviceId, String parentId, boolean onlyCatalog);
List<DeviceChannel> getSubChannelsByDeviceId(@Param("deviceId") String deviceId, @Param("parentId") String parentId, @Param("onlyCatalog") boolean onlyCatalog);
}

View File

@ -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 = {" <script>" +
"UPDATE wvp_device " +

View File

@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
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 java.util.List;
@ -23,7 +24,7 @@ public interface DeviceMobilePositionMapper {
"<if test=\"endTime != null\"> AND time&lt;=#{endTime}</if>" +
" ORDER BY time ASC" +
" </script>"})
List<MobilePosition> queryPositionByDeviceIdAndTime(String deviceId, String channelId, String startTime, String endTime);
List<MobilePosition> 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")

View File

@ -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("<script> "+
"SELECT gs.* FROM wvp_gb_stream gs " +
@ -61,10 +62,10 @@ public interface GbStreamMapper {
" <if test='mediaServerId != null' > AND gs.media_server_id=#{mediaServerId} </if>" +
" order by gs.gb_stream_id asc " +
"</script>")
List<GbStream> selectAll(String platformId, String catalogId, String query, String mediaServerId);
List<GbStream> 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<GbStream> 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("<script> "+
"select gt.gb_id as channel_id, gt.name, 'wvp-pro' as manufacture, st.status, gt.longitude, gt.latitude, pc.id as parent_id," +
@ -90,7 +91,7 @@ public interface GbStreamMapper {
" left join wvp_platform_catalog pc on pgs.catalog_id = pc.id and pgs.platform_id = pc.platform_id" +
" where pgs.platform_id=#{platformId}" +
"</script>")
List<DeviceChannel> queryGbStreamListInPlatform(String platformId, boolean usPushingAsStatus);
List<DeviceChannel> 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<GbStream> 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("<script> "+
"DELETE FROM wvp_gb_stream where " +
@ -128,7 +129,7 @@ public interface GbStreamMapper {
"</foreach> " +
"</script>")
@Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gb_stream_id")
void batchAdd(List<StreamPushItem> subList);
void batchAdd(@Param("subList") List<StreamPushItem> subList);
@Update({"<script>" +
"<foreach collection='gpsMsgInfos' item='item' separator=';'>" +
@ -164,9 +165,9 @@ public interface GbStreamMapper {
int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate);
@Select("SELECT status FROM wvp_stream_proxy WHERE app=#{app} AND stream=#{stream}")
Boolean selectStatusForProxy(String app, String stream);
Boolean selectStatusForProxy(@Param("app") String app, @Param("stream") String stream);
@Select("SELECT status FROM wvp_stream_push WHERE app=#{app} AND stream=#{stream}")
Boolean selectStatusForPush(String app, String stream);
Boolean selectStatusForPush(@Param("app") String app, @Param("stream") String stream);
}

View File

@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.storager.dao.dto.LogDto;
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;
@ -29,7 +30,7 @@ public interface LogMapper {
" <if test=\"endTime != null\" > AND create_time &lt;= #{endTime} </if>" +
" ORDER BY create_time DESC " +
" </script>"})
List<LogDto> query(String query, String type, String startTime, String endTime);
List<LogDto> query(@Param("query") String query, @Param("type") String type, @Param("startTime") String startTime, @Param("endTime") String endTime);
@Delete("DELETE FROM wvp_log")
int clear();

View File

@ -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();

View File

@ -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 = {" <script>" +
"UPDATE wvp_platform " +
"SET catalog_id=#{catalogId}, update_time=#{updateTime}" +
"WHERE server_gb_id=#{platformId}"+
"</script>"})
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<ChannelSourceInfo> getChannelSource(String platform_id, String gbId);
List<ChannelSourceInfo> getChannelSource(@Param("platform_id") String platform_id, @Param("gbId") String gbId);
}

View File

@ -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<PlatformCatalog> selectByParentId(String platformId, String parentId);
List<PlatformCatalog> selectByParentId(@Param("platformId") String platformId, @Param("parentId") String parentId);
@Update(value = {" <script>" +
"UPDATE wvp_platform_catalog " +
"SET name=#{name}" +
"WHERE id=#{id} and platform_id=#{platformId}"+
"</script>"})
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<PlatformCatalog> selectByPlatForm(String platformId);
List<PlatformCatalog> 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<DeviceChannel> queryCatalogInPlatform(String platformId);
List<DeviceChannel> 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);
}

View File

@ -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" +
"<foreach collection='channelReduces' open='(' item='item' separator=',' close=')'> #{item.id}</foreach>" +
"</script>")
List<Integer> findChannelRelatedPlatform(String platformId, List<ChannelReduce> channelReduces);
List<Integer> findChannelRelatedPlatform(@Param("platformId") String platformId, @Param("channelReduces") List<ChannelReduce> channelReduces);
@Insert("<script> "+
"INSERT INTO wvp_platform_gb_channel (platform_id, device_channel_id, catalog_id) VALUES" +
@ -32,13 +33,13 @@ public interface PlatformChannelMapper {
" (#{platformId}, #{item.id} , #{item.catalogId} )" +
"</foreach>" +
"</script>")
int addChannels(String platformId, List<ChannelReduce> channelReducesToAdd);
int addChannels(@Param("platformId") String platformId, @Param("channelReducesToAdd") List<ChannelReduce> channelReducesToAdd);
@Delete("<script> "+
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
"<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" +
"</script>")
int delChannelForGB(String platformId, List<ChannelReduce> channelReducesToDel);
int delChannelForGB(@Param("platformId") String platformId, @Param("channelReducesToDel") List<ChannelReduce> channelReducesToDel);
@Delete("<script> "+
"DELETE from wvp_platform_gb_channel WHERE device_channel_id in " +
@ -55,27 +56,27 @@ public interface PlatformChannelMapper {
int cleanChannelForGB(String platformId);
@Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}")
List<DeviceChannel> queryChannelInParentPlatform(String platformId, String channelId);
List<DeviceChannel> queryChannelInParentPlatform(@Param("platformId") String platformId, @Param("channelId") String channelId);
@Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}")
List<DeviceChannel> queryAllChannelInCatalog(String platformId, String catalogId);
List<DeviceChannel> queryAllChannelInCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select(" select dc.channel_id as id, dc.name as name, pgc.platform_id as platform_id, pgc.catalog_id as parent_id, 0 as children_count, 1 as type " +
" from wvp_device_channel dc left join wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id " +
" where pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}")
List<PlatformCatalog> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId);
List<PlatformCatalog> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select("select d.*\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<Device> queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
List<Device> queryVideoDeviceByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
@Delete("<script> "+
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} and catalog_id=#{id}" +
"</script>")
int delByCatalogId(String platformId, String id);
int delByCatalogId(@Param("platformId") String platformId, @Param("id") String id);
@Delete("<script> "+
"DELETE from wvp_platform_gb_channel WHERE catalog_id=#{parentId} AND platform_id=#{platformId} AND channel_id=#{id}" +
@ -96,7 +97,7 @@ public interface PlatformChannelMapper {
"AND pp.server_gb_id IN" +
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
"</script> ")
List<ParentPlatform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms);
List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List<String> platforms);
@Delete("<script> " +
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{serverGBId}" +
@ -106,14 +107,14 @@ public interface PlatformChannelMapper {
@Delete("<script> " +
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} and catalog_id=#{catalogId}" +
"</script>")
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<Device> queryDeviceInfoByPlatformIdAndChannelId(String platformId, String channelId);
List<Device> 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<String> queryParentPlatformByChannelId(String channelId);

View File

@ -32,7 +32,7 @@ public interface PlatformGbStreamMapper {
int batchAdd(List<StreamPushItem> 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<ParentPlatform> selectByAppAndStream(String app, String stream);
List<ParentPlatform> 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<GbStream> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId);
List<GbStream> 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<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId);
List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select("<script> " +
"SELECT " +
@ -82,7 +82,7 @@ public interface PlatformGbStreamMapper {
"AND pp.server_gb_id IN" +
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
"</script> ")
List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms);
List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("app") String app, @Param("stream") String stream, @Param("platforms") List<String> 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} " +
"</foreach>" +
"</script>")
void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId);
void delByAppAndStreamsByPlatformId(@Param("gbStreams") List<GbStream> 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);
}

View File

@ -49,12 +49,12 @@ public interface StreamProxyMapper {
List<StreamProxyItem> 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<StreamProxyItem> selectForEnableInMediaServer(String id, boolean enable);
List<StreamProxyItem> 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);

View File

@ -79,13 +79,13 @@ public interface StreamPushMapper {
" <if test='mediaServerId != null' > AND st.media_server_id=#{mediaServerId} </if>" +
"order by st.create_time desc" +
" </script>"})
List<StreamPushItem> selectAllForList(String query, Boolean pushing, String mediaServerId);
List<StreamPushItem> 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<StreamPushItem> 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("<script>" +
"Insert INTO wvp_stream_push (app, stream, total_reader_count, origin_type, origin_type_str, " +
@ -122,17 +122,17 @@ public interface StreamPushMapper {
@Update("UPDATE wvp_stream_push " +
"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);
@Update("UPDATE wvp_stream_push " +
"SET push_ing=#{pushIng} " +
"WHERE app=#{app} AND stream=#{stream}")
int updatePushStatus(String app, String stream, boolean pushIng);
int updatePushStatus(@Param("app") String app, @Param("stream") String stream, @Param("pushIng") boolean pushIng);
@Update("UPDATE wvp_stream_push " +
"SET status=#{status} " +
"WHERE media_server_id=#{mediaServerId}")
void updateStatusByMediaServerId(String mediaServerId, boolean status);
void updateStatusByMediaServerId(@Param("mediaServerId") String mediaServerId, @Param("status") boolean status);
@Select("<script> "+

View File

@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.storager.dao;
import com.genersoft.iot.vmp.storager.dao.dto.User;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -36,7 +37,7 @@ public interface UserMapper {
@Result(column = "role_create_time", property = "role.createTime"),
@Result(column = "role_update_time", property = "role.updateTime")
})
User select(String username, String password);
User select(@Param("username") String username, @Param("password") String password);
@Select("select u.*, r.id as role_id, r.name as role_name, r.authority as role_authority , r.create_time as role_create_time , r.update_time as role_update_time from wvp_user u, wvp_user_role r WHERE u.role_id=r.id and u.id=#{id}")
@ResultMap(value="roleMap")
@ -55,5 +56,5 @@ public interface UserMapper {
List<User> getUsers();
@Update("UPDATE wvp_user set push_key=#{pushKey} where id=#{id}")
int changePushKey(int id, String pushKey);
int changePushKey(@Param("id") int id, @Param("pushKey") String pushKey);
}