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/MissionRep.kt |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/domain/repository/MissionRep.kt b/src/main/kotlin/com/flightfeather/uav/domain/repository/MissionRep.kt
index ce7cdec..164f303 100644
--- a/src/main/kotlin/com/flightfeather/uav/domain/repository/MissionRep.kt
+++ b/src/main/kotlin/com/flightfeather/uav/domain/repository/MissionRep.kt
@@ -2,6 +2,7 @@
 
 import com.flightfeather.uav.domain.entity.Mission
 import com.flightfeather.uav.domain.mapper.MissionMapper
+import com.flightfeather.uav.lightshare.bean.AreaVo
 import org.springframework.stereotype.Repository
 import tk.mybatis.mapper.entity.Example
 import java.util.*
@@ -44,4 +45,25 @@
                 .andIsNotNull("endTime")
         })
     }
+    
+    /**
+     * 鏍规嵁鍖哄煙鍜屾椂闂磋寖鍥存煡璇㈡湁鏁堣蛋鑸换鍔″垪琛�
+     * 绛涢�夋寚瀹氳鏀垮尯鍒掑唴銆佺壒瀹氭椂闂存涓斿凡瀹屾垚鏈夋晥閲岀▼璁板綍鐨勮蛋鑸换鍔�
+     * @param areaVo 鍖哄煙鍙傛暟瀵硅薄锛屽寘鍚渷銆佸競銆佸尯涓夌骇琛屾斂鍖哄垝缂栫爜
+     * @param startTime 鏌ヨ璧峰鏃堕棿锛堝寘鍚級
+     * @param endTime 鏌ヨ缁撴潫鏃堕棿锛堝寘鍚級
+     * @return 绗﹀悎鏉′欢鐨勮蛋鑸换鍔″垪琛紝鑻ユ棤鍙繑鍥炵┖鍒楄〃
+     * @see AreaVo 鍖哄煙鍙傛暟鏁版嵁缁撴瀯
+     * @see Mission 璧拌埅浠诲姟瀹炰綋绫�
+     */
+    fun findByAreaAndTime(areaVo: AreaVo, startTime: Date, endTime: Date): List<Mission?> {
+        return missionMapper.selectByExample(Example(Mission::class.java).apply {
+            createCriteria().andBetween("startTime", startTime, endTime)
+                .andEqualTo("provinceCode", areaVo.provinceCode)
+                .andEqualTo("cityCode", areaVo.cityCode)
+                .andEqualTo("districtCode", areaVo.districtCode)
+                .andIsNotNull("kilometres")
+                .andNotEqualTo("kilometres", 0)
+        })
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3