|
@@ -144,7 +144,7 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
|
|
|
" from store_evaluation eval " +
|
|
" from store_evaluation eval " +
|
|
|
" where eval.store_id = a.id and eval.delete_flag = 0 " +
|
|
" where eval.store_id = a.id and eval.delete_flag = 0 " +
|
|
|
") score, " +
|
|
") score, " +
|
|
|
- "ROUND(ST_Distance_Sphere(ST_GeomFromText(CONCAT('POINT(', REPLACE(#{position}, ',', ' '), ')' )), ST_GeomFromText(CONCAT('POINT(', REPLACE(a.store_position, ',', ' '), ')' ))) / 1000, 2) dist " +
|
|
|
|
|
|
|
+ "ROUND(ST_Distance_Sphere(ST_GeomFromText(CONCAT('POINT(', REPLACE(#{position}, ',', ' '), ')' )), ST_GeomFromText(CONCAT('POINT(', REPLACE(a.store_position, ',', ' '), ')' ))), 0) distance3 " +
|
|
|
"from store_info a " +
|
|
"from store_info a " +
|
|
|
"left join store_user b on a.id = b.store_id and a.delete_flag = 0 and b.delete_flag = 0 " +
|
|
"left join store_user b on a.id = b.store_id and a.delete_flag = 0 and b.delete_flag = 0 " +
|
|
|
"left join store_img img on img.store_id = a.id and img.img_type = 1 and img.delete_flag = 0 " +
|
|
"left join store_img img on img.store_id = a.id and img.img_type = 1 and img.delete_flag = 0 " +
|
|
@@ -155,6 +155,6 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
|
|
|
"${ew.customSqlSegment} " +
|
|
"${ew.customSqlSegment} " +
|
|
|
"and a.store_position is not null and a.store_position != '' " +
|
|
"and a.store_position is not null and a.store_position != '' " +
|
|
|
"and ROUND(ST_Distance_Sphere(ST_GeomFromText(CONCAT('POINT(', REPLACE(#{position}, ',', ' '), ')' )), ST_GeomFromText(CONCAT('POINT(', REPLACE(a.store_position, ',', ' '), ')' ))) / 1000, 2) <= 1 " +
|
|
"and ROUND(ST_Distance_Sphere(ST_GeomFromText(CONCAT('POINT(', REPLACE(#{position}, ',', ' '), ')' )), ST_GeomFromText(CONCAT('POINT(', REPLACE(a.store_position, ',', ' '), ')' ))) / 1000, 2) <= 1 " +
|
|
|
- "order by dist asc limit 20")
|
|
|
|
|
|
|
+ "order by distance3 asc limit 20")
|
|
|
List<StoreInfoVo> getMoreRecommendedStores(@Param(Constants.WRAPPER) QueryWrapper<StoreInfoVo> queryWrapper, @Param("position") String position);
|
|
List<StoreInfoVo> getMoreRecommendedStores(@Param(Constants.WRAPPER) QueryWrapper<StoreInfoVo> queryWrapper, @Param("position") String position);
|
|
|
}
|
|
}
|