fix
Hentua
2023-06-15 8bf923b44bbe9b45b73ddcc25df75c9c59f54e07
src/main/resources/mapper/modules/MallShopMapper.xml
@@ -3,7 +3,10 @@
<mapper namespace="cc.mrbird.febs.mall.mapper.MallShopMapper">
    <select id="selectShopListInPage" resultType="cc.mrbird.febs.mall.entity.MallShop">
        select * from mall_shop
        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">
@@ -15,6 +18,28 @@
                </if>
            </if>
        </where>
        order by id desc
    </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>
        limit #{page.pageNum},#{page.pageSize}
    </select>
</mapper>