fix
Hentua
2023-04-23 fc093b0724b0c8979c0896f2bdc4cf8c4af27a1f
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>