fix(订单中心):首页附近景区列表数据逻辑优化,删除用户为直接删除数据逻辑优化
This commit is contained in:
@@ -36,4 +36,42 @@
|
||||
AND t.is_del = 0
|
||||
ORDER BY q.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询附近景区列表 -->
|
||||
<select id="findNearbyTourisms" resultType="com.central.order.model.TourismWithDistance">
|
||||
<![CDATA[
|
||||
SELECT
|
||||
*,
|
||||
(
|
||||
6371 * acos(
|
||||
cos(radians(#{latitude})) *
|
||||
cos(radians(latitude)) *
|
||||
cos(radians(longitude) - radians(#{longitude})) +
|
||||
sin(radians(#{latitude})) *
|
||||
sin(radians(latitude))
|
||||
)
|
||||
) AS distance
|
||||
FROM tourisms
|
||||
WHERE is_del = 0
|
||||
AND status = 1
|
||||
AND longitude IS NOT NULL
|
||||
AND latitude IS NOT NULL
|
||||
HAVING distance <= #{radius}
|
||||
ORDER BY distance ASC
|
||||
]]>
|
||||
<if test="limit != null and limit > 0">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 根据经纬度范围查询景区 -->
|
||||
<select id="findTourismsByBounds" resultType="com.central.order.model.Tourism">
|
||||
SELECT * FROM tourisms
|
||||
WHERE is_del = 0
|
||||
AND status = 1
|
||||
AND longitude BETWEEN #{minLongitude} AND #{maxLongitude}
|
||||
AND latitude BETWEEN #{minLatitude} AND #{maxLatitude}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user