From 94fee0b511279679b43e210878d3d36e5a14384b Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 30 九月 2025 09:14:10 +0800 Subject: [PATCH] 2025.9.30 1. 新增走航任务统计功能 --- src/main/kotlin/com/flightfeather/uav/domain/repository/RealTimeDataRepDelegate.kt | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/uav/domain/repository/RealTimeDataRepDelegate.kt b/src/main/kotlin/com/flightfeather/uav/domain/repository/RealTimeDataRepDelegate.kt index 8ce8813..3628b1b 100644 --- a/src/main/kotlin/com/flightfeather/uav/domain/repository/RealTimeDataRepDelegate.kt +++ b/src/main/kotlin/com/flightfeather/uav/domain/repository/RealTimeDataRepDelegate.kt @@ -89,6 +89,32 @@ } /** + * 缁熶竴鐨剈pdate鏂规硶 + * @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 + } + + /** * 缁熶竴鐨刣elete鏂规硶 * @param deviceType 璁惧绫诲瀷 * @param type 鏁版嵁缁熻鍛ㄦ湡锛�0锛氱绾у�硷紱1锛氬垎閽熷�� -- Gitblit v1.9.3