From f21b1c12248daaac71491aaf2e46908fadc63377 Mon Sep 17 00:00:00 2001
From: Hentua <wangdoubleone@gmail.com>
Date: Sun, 11 Jun 2023 11:34:21 +0800
Subject: [PATCH] fix
---
src/main/resources/mapper/modules/MallShopMapper.xml | 23 ++++++++++++++++++++---
1 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/main/resources/mapper/modules/MallShopMapper.xml b/src/main/resources/mapper/modules/MallShopMapper.xml
index 413eb6b..3a47643 100644
--- a/src/main/resources/mapper/modules/MallShopMapper.xml
+++ b/src/main/resources/mapper/modules/MallShopMapper.xml
@@ -18,11 +18,28 @@
</if>
</if>
</where>
+ </select>
+
+
+ <select id="selectShopDistanceList" resultType="cc.mrbird.febs.mall.entity.MallShop">
+ select
+ a.*,
+ lat_lng_distance(#{record.latitude}, #{record.longitude}, a.latitude, a.longitude) distance
+ from mall_shop a
+ <where>
+ 1=1
+ <if test="record != null">
+ <if test="record.shopName != null and record.shopName != ''">
+ and shop_name like concat('%', concat(#{record.shopName}, '%'))
+ </if>
+ <if test="record.state != null">
+ and state = #{record.state}
+ </if>
+ </if>
+ </where>
<if test="record.longitude != null and record.latitude != null">
order by lat_lng_distance(#{record.latitude}, #{record.longitude}, a.latitude, a.longitude) desc
</if>
- <if test="record.longitude == null or record.latitude == null">
- order by id desc
- </if>
+ limit #{page.pageNum},#{page.pageSize}
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1