From 748fc948fff5b0034dbea1110fabf11d22573e14 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Mon, 22 Jul 2024 15:42:57 +0800
Subject: [PATCH] 代码优化

---
 src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
index 4a9090b..fa02706 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -70,6 +70,14 @@
             and jp.is_nine = #{place.isNine}
         </if>
 
+        <if test="place.noExplosionCategory!=null">
+            and jp.no_explosion_category is not null
+            <if test="place.noExplosionCategory!=null and place.noExplosionCategory > 0 ">
+                and jp.no_explosion_category = #{place.noExplosionCategory}
+            </if>
+        </if>
+
+
         <if test="place.source!=null">
             and jp.source = #{place.source}
         </if>
@@ -1087,4 +1095,22 @@
         order by jp.create_time desc,jp.id desc
     </select>
 
+    <select id="getNearbyPlaceList" resultType="org.springblade.modules.place.vo.PlaceVO">
+        SELECT
+        jp.id,
+        jp.lat,
+        jp.lng,
+        jp.place_name,
+        ( 6371 * acos( cos( radians(#{param1}) ) * cos( radians( jp.lat ) )
+        * cos( radians( jp.lng ) - radians(#{param2}) )
+        + sin( radians(#{param1}) ) * sin( radians( jp.lat ) ) ) ) AS distance
+        FROM jczz_place jp
+        where jp.place_name is not null
+        and jp.lat is not null
+        and jp.lng is not null
+        and jp.is_deleted = 0
+        HAVING distance &lt;= 1
+        ORDER BY distance limit 30
+    </select>
+
 </mapper>

--
Gitblit v1.9.3