Преглед изворни кода

店铺详情接口距离用sql计算

jyc пре 4 недеља
родитељ
комит
fa69822170
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      alien-entity/src/main/java/shop/alien/mapper/StoreInfoMapper.java

+ 1 - 1
alien-entity/src/main/java/shop/alien/mapper/StoreInfoMapper.java

@@ -126,7 +126,7 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
 
     @Select(
             "select " +
-            "            ROUND(ST_Distance_Sphere(ST_GeomFromText(CONCAT('POINT(', REPLACE(#{position}, ',', ' '), ')' )), ST_GeomFromText(CONCAT('POINT(', REPLACE(store_position, ',', ' '), ')' ))) / 1000, 2) dist " +
+            "            ROUND(ST_Distance_Sphere(ST_GeomFromText(CONCAT('POINT(', REPLACE(#{position}, ',', ' '), ')' )), ST_GeomFromText(CONCAT('POINT(', REPLACE(store_position, ',', ' '), ')' ))) / 1000, 1) dist " +
             "from store_info where id = #{storeId}"
             )
     Double getStoreDistance(@Param("position") String position,@Param("storeId") Integer storeId);