| | |
| | | package com.genersoft.iot.vmp.policeBodyCamera.mapper; |
| | | |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| | | import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; |
| | | import com.genersoft.iot.vmp.policeBodyCamera.entity.DeviceChannelPoliceCamera; |
| | | import com.genersoft.iot.vmp.vmanager.bean.DeviceChannelTree; |
| | | import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; |
| | |
| | | " where deviceId = #{deviceId} " + |
| | | " and channelId = #{channelId}") |
| | | int updateChannelSubCount(String deviceId, String channelId); |
| | | |
| | | /** |
| | | * 添加执法记录仪移动位置信息 |
| | | * @param mobilePosition |
| | | * @return |
| | | */ |
| | | @Insert("INSERT INTO device_mobile_position_police_camera (deviceId,channelId, deviceName, time, longitude, latitude, altitude, speed, direction, reportSource, geodeticSystem, cnLng, cnLat) " + |
| | | "VALUES ('${deviceId}','${channelId}', '${deviceName}', '${time}', ${longitude}, ${latitude}, ${altitude}, ${speed}, ${direction}, '${reportSource}', '${geodeticSystem}', '${cnLng}', '${cnLat}')") |
| | | int insertNewPositionPoliceCamera(MobilePosition mobilePosition); |
| | | } |
| | |
| | | package com.genersoft.iot.vmp.policeBodyCamera.service; |
| | | |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| | | import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; |
| | | |
| | | public interface DeviceChannelPoliceCameraService { |
| | | |
| | |
| | | * @param channelId |
| | | */ |
| | | void del(String deviceId, String channelId); |
| | | |
| | | /** |
| | | * 添加执法记录仪移动位置信息 |
| | | * @param mobilePosition |
| | | */ |
| | | void insertNewPositionPoliceCamera(MobilePosition mobilePosition); |
| | | } |
| | |
| | | |
| | | import com.genersoft.iot.vmp.common.StreamInfo; |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| | | import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; |
| | | import com.genersoft.iot.vmp.policeBodyCamera.entity.DeviceChannelPoliceCamera; |
| | | import com.genersoft.iot.vmp.policeBodyCamera.mapper.DeviceChannelPoliceCameraMapper; |
| | | import com.genersoft.iot.vmp.policeBodyCamera.service.DeviceChannelPoliceCameraService; |
| | |
| | | public void del(String deviceId, String channelId) { |
| | | deviceChannelPoliceCameraMapper.del(deviceId,channelId); |
| | | } |
| | | |
| | | /** |
| | | * 添加执法记录仪移动位置信息 |
| | | * @param mobilePosition |
| | | */ |
| | | @Override |
| | | public void insertNewPositionPoliceCamera(MobilePosition mobilePosition) { |
| | | deviceChannelPoliceCameraMapper.insertNewPositionPoliceCamera(mobilePosition); |
| | | } |
| | | } |
| | |
| | | public int delChannel(String deviceId, String channelId) { |
| | | //查询设备信息 |
| | | DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(deviceId, channelId); |
| | | if (deviceChannel.getName().equals("执法记录仪")){ |
| | | if (deviceChannel.getName().contains("执法记录仪")){ |
| | | //同时删除执法记录仪信息 |
| | | deviceChannelPoliceCameraService.del(deviceId, channelId); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public synchronized boolean insertMobilePosition(MobilePosition mobilePosition) { |
| | | if (mobilePosition.getDeviceName().contains("执法记录仪")){ |
| | | deviceChannelPoliceCameraService.insertNewPositionPoliceCamera(mobilePosition); |
| | | } |
| | | return deviceMobilePositionMapper.insertNewPosition(mobilePosition) > 0; |
| | | } |
| | | |