| | |
| | | } |
| | | |
| | | /** |
| | | * 统一的update方法 |
| | | * @param deviceType 设备类型 |
| | | * @param type 数据统计周期,0:秒级值;1:分钟值 |
| | | * @param data 数据 |
| | | */ |
| | | fun updateByDeviceType(deviceType: UWDeviceType?, type: Int? = 0, data: List<BaseRealTimeData>): Int { |
| | | return byDeviceType(deviceType, type, { |
| | | var count = 0 |
| | | data.forEach { count += realTimeDataVehicleMapper.updateByPrimaryKeySelective(it as RealTimeDataVehicle) } |
| | | count |
| | | }, { |
| | | var count = 0 |
| | | data.forEach { count += realTimeDataUavMapper.updateByPrimaryKeySelective(it as RealTimeDataUav) } |
| | | count |
| | | }, { |
| | | var count = 0 |
| | | data.forEach { count += realTimeDataGridMapper.updateByPrimaryKeySelective(it as RealTimeDataGrid) } |
| | | count |
| | | }, { |
| | | var count = 0 |
| | | data.forEach { count += realTimeDataGridMinMapper.updateByPrimaryKeySelective(it as RealTimeDataGridMin) } |
| | | count |
| | | }) ?: 0 |
| | | } |
| | | |
| | | /** |
| | | * 统一的delete方法 |
| | | * @param deviceType 设备类型 |
| | | * @param type 数据统计周期,0:秒级值;1:分钟值 |