From 1dfb91db022f6cfa4bcb9d953ca9aa8a503e1ca5 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期六, 12 七月 2025 11:47:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml
index cbedca2..9443e27 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml
@@ -242,5 +242,34 @@
         </where>
          order by t1.implement_time desc
     </select>
+    <select id="indexTask" resultType="com.ruoyi.system.model.TTask">
+        select t1.*,
+               ROUND(
+                       6378.138 * 2 * ASIN(
+                               SQRT(
+                                       POW(
+                                               SIN(
+                                                       (
+                                                           #{query.lat} * PI() / 180 - t2.location_lat * PI() / 180
+                                                           ) / 2
+                                               ),
+                                               2
+                                       ) + COS(#{query.lat} * PI() / 180) * COS(t2.location_lat * PI() / 180) * POW(
+                                               SIN(
+                                                       (
+                                                           #{query.lon} * PI() / 180 - t2.location_lon * PI() / 180
+                                                           ) / 2
+                                               ),
+                                               2
+                                                                                                                )
+                               )
+                                      ) * 1000
+               ) AS distance
+        from t_task t1
+        left join t_location t2 on t1.location_id = t2.id
+        where t1.`disabled` = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
+
+       and t1.patrol_inspector = #{query.userId}
+    </select>
 
 </mapper>

--
Gitblit v1.7.1