| | |
| | | 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; |
| | | |
| | |
| | | " <if test=\"endTime != null\" > AND alarm_time <= #{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>" + |
| | |
| | | " <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); |
| | | } |
| | |
| | | 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; |
| | |
| | | "</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 " + |
| | |
| | | "</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>" + |
| | |
| | | "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 " + |
| | |
| | | " <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 " + |
| | |
| | | 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); |
| | |
| | | "#{item.businessGroupId}, #{item.gpsTime}) " + |
| | | "</foreach> " + |
| | | "</script>") |
| | | int batchAdd(List<DeviceChannel> addChannels); |
| | | int batchAdd(@Param("addChannels") List<DeviceChannel> addChannels); |
| | | |
| | | |
| | | @Insert("<script> " + |
| | |
| | | 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=';'>" + |
| | |
| | | " 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 *" + |
| | |
| | | " 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 " + |
| | |
| | | " <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 " + |
| | |
| | | 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, " + |
| | |
| | | "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=';'>" + |
| | |
| | | " <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); |
| | | |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | "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 " + |
| | |
| | | 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; |
| | |
| | | "<if test=\"endTime != null\"> AND time<=#{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") |
| | |
| | | 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; |
| | |
| | | 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 " + |
| | |
| | | " <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); |
| | |
| | | @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," + |
| | |
| | | " 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 " + |
| | |
| | | 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 " + |
| | |
| | | "</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=';'>" + |
| | |
| | | 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); |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | " <if test=\"endTime != null\" > AND create_time <= #{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(); |
| | |
| | | |
| | | 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; |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | "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" + |
| | |
| | | " (#{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 " + |
| | |
| | | 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}" + |
| | |
| | | "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}" + |
| | |
| | | @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); |
| | |
| | | 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); |
| | |
| | | "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 " + |
| | |
| | | "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); |
| | |
| | | "#{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); |
| | | } |
| | |
| | | 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 " + |
| | |
| | | @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); |
| | |
| | | " <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, " + |
| | |
| | | @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> "+ |
| | |
| | | |
| | | 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; |
| | |
| | | @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") |
| | |
| | | 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); |
| | | } |