| | |
| | | if (!ObjectUtils.isEmpty(device.getName())) { |
| | | mobilePosition.setDeviceName(device.getName()); |
| | | } |
| | | |
| | | mobilePosition.setDeviceName(device.getName()); |
| | | mobilePosition.setDeviceId(device.getDeviceId()); |
| | | mobilePosition.setChannelId(channelId); |
| | | String time = XmlUtil.getText(rootElement, "Time"); |
| | |
| | | return port; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | interface CheckPortCallback{ |
| | |
| | | |
| | | @Override |
| | | public void batchUpdateChannelGPS(List<DeviceChannel> channelList) { |
| | | |
| | | channelMapper.batchUpdatePosition(channelList); |
| | | } |
| | | |
| | | @Override |
| | | public void batchAddMobilePosition(List<MobilePosition> mobilePositions) { |
| | | |
| | | deviceMobilePositionMapper.batchInsert(mobilePositions); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | " <if test='channelId != null'> and channel_id = #{channelId} </if>" + |
| | | "</script>") |
| | | void updateChannelStreamIdentification(DeviceChannel channel); |
| | | |
| | | |
| | | @Update({"<script>" + |
| | | "<foreach collection='channelList' item='item' separator=';'>" + |
| | | " UPDATE" + |
| | | " wvp_device_channel" + |
| | | " SET update_time=#{item.updateTime}" + |
| | | "<if test='item.longitude != null'>, longitude=#{item.longitude}</if>" + |
| | | "<if test='item.latitude != null'>, latitude=#{item.latitude}</if>" + |
| | | "<if test='item.longitudeGcj02 != null'>, longitude_gcj02=#{item.longitudeGcj02}</if>" + |
| | | "<if test='item.latitudeGcj02 != null'>, latitude_gcj02=#{item.latitudeGcj02}</if>" + |
| | | "<if test='item.longitudeWgs84 != null'>, longitude_wgs84=#{item.longitudeWgs84}</if>" + |
| | | "<if test='item.latitudeWgs84 != null'>, latitude_wgs84=#{item.latitudeWgs84}</if>" + |
| | | "<if test='item.gpsTime != null'>, gps_time=#{item.gpsTime}</if>" + |
| | | "<if test='item.id > 0'>WHERE id=#{item.id}</if>" + |
| | | "<if test='item.id == 0'>WHERE device_id=#{item.deviceId} AND channel_id=#{item.channelId}</if>" + |
| | | "</foreach>" + |
| | | "</script>"}) |
| | | void batchUpdatePosition(List<DeviceChannel> channelList); |
| | | |
| | | } |
| | |
| | | public interface DeviceMobilePositionMapper { |
| | | |
| | | @Insert("INSERT INTO wvp_device_mobile_position (device_id,channel_id, device_name,time,longitude,latitude,altitude,speed,direction,report_source,longitude_gcj02,latitude_gcj02,longitude_wgs84,latitude_wgs84,create_time)"+ |
| | | "VALUES (#{deviceId}, #{channelId}, #{deviceName}, #{time}, #{longitude}, #{latitude}, #{altitude}, #{speed}, #{direction}, #{reportSource}, #{longitudeGcj02}, #{latitudeGcj02}, #{longitudeWgs84}, #{latitudeWgs84}, #{createTime})") |
| | | "VALUES (#{deviceId}, #{channelId}, #{deviceName}, #{time}, #{longitude}, #{latitude}, #{altitude}, " + |
| | | "#{speed}, #{direction}, #{reportSource}, #{longitudeGcj02}, #{latitudeGcj02}, #{longitudeWgs84}, #{latitudeWgs84}, #{createTime})") |
| | | int insertNewPosition(MobilePosition mobilePosition); |
| | | |
| | | @Select(value = {" <script>" + |
| | |
| | | @Delete("DELETE FROM wvp_device_mobile_position WHERE device_id = #{deviceId}") |
| | | int clearMobilePositionsByDeviceId(String deviceId); |
| | | |
| | | @Insert("<script> " + |
| | | "insert into wvp_device_mobile_position " + |
| | | "(device_id,channel_id, device_name,time,longitude," + |
| | | "latitude,altitude,speed,direction," + |
| | | "report_source,longitude_gcj02,latitude_gcj02," + |
| | | "longitude_wgs84,latitude_wgs84,create_time)"+ |
| | | "values " + |
| | | "<foreach collection='mobilePositions' index='index' item='item' separator=','> " + |
| | | "(#{item.deviceId}, #{item.channelId}, #{item.deviceName}, #{item.time}, #{item.longitude}, " + |
| | | "#{item.latitude}, #{item.altitude}, #{item.speed},#{item.direction}," + |
| | | "#{item.reportSource}, #{item.longitudeGcj02}, #{item.latitudeGcj02}, " + |
| | | "#{item.longitudeWgs84}, #{item.latitudeWgs84}, #{item.createTime}) " + |
| | | "</foreach> " + |
| | | "</script>") |
| | | void batchInsert(List<MobilePosition> mobilePositions); |
| | | } |