<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.czg.service.account.mapper.ShopInfoMapper">

    <select id="getSubList" resultType="com.czg.account.dto.shopinfo.ShopInfoSubVO">
        select ST_Distance_Sphere(
                       POINT(lng, lat),
                       POINT(#{lng}, #{lat})
               ) / 1000 AS distance, id, shop_name, logo, phone, address
        from tb_shop_info
        WHERE ST_Distance_Sphere(POINT(lng, lat), POINT(#{lng}, #{lat})) &lt;= #{distance}
        order by distance
    </select>
</mapper>
