linwe
2024-07-22 748fc948fff5b0034dbea1110fabf11d22573e14
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>