|
@@ -135,6 +135,7 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
|
|
|
* 更多推荐(用户端)
|
|
* 更多推荐(用户端)
|
|
|
*
|
|
*
|
|
|
* @param queryWrapper 查询条件
|
|
* @param queryWrapper 查询条件
|
|
|
|
|
+ * @param position 经纬度位置(格式:经度,纬度)
|
|
|
* @return List<StoreInfoVo>
|
|
* @return List<StoreInfoVo>
|
|
|
*/
|
|
*/
|
|
|
@Select("select a.*, img.img_url entranceImage,img1.img_url foodLicenceImageUrl,b.name store_contact, b.phone store_phone, b.id_card idCard, b.password, c.dict_detail store_status_str, d.dict_detail business_status_str, e.dict_detail store_type_str, " +
|
|
@Select("select a.*, img.img_url entranceImage,img1.img_url foodLicenceImageUrl,b.name store_contact, b.phone store_phone, b.id_card idCard, b.password, c.dict_detail store_status_str, d.dict_detail business_status_str, e.dict_detail store_type_str, " +
|
|
@@ -142,7 +143,8 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
|
|
|
" select ifnull(round(avg(score), 1), 0) " +
|
|
" select ifnull(round(avg(score), 1), 0) " +
|
|
|
" 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 " +
|
|
|
"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 " +
|
|
@@ -150,6 +152,9 @@ public interface StoreInfoMapper extends BaseMapper<StoreInfo> {
|
|
|
"left join store_dictionary c on a.store_status = c.dict_id and c.type_name = 'storeState' and c.delete_flag = 0 " +
|
|
"left join store_dictionary c on a.store_status = c.dict_id and c.type_name = 'storeState' and c.delete_flag = 0 " +
|
|
|
"left join store_dictionary d on a.business_status = d.dict_id and d.type_name = 'businessStatus' and d.delete_flag = 0 " +
|
|
"left join store_dictionary d on a.business_status = d.dict_id and d.type_name = 'businessStatus' and d.delete_flag = 0 " +
|
|
|
"left join store_dictionary e on e.type_name = 'storeType' and e.dict_id = a.store_type and e.delete_flag = 0 " +
|
|
"left join store_dictionary e on e.type_name = 'storeType' and e.dict_id = a.store_type and e.delete_flag = 0 " +
|
|
|
- "${ew.customSqlSegment}")
|
|
|
|
|
- List<StoreInfoVo> getMoreRecommendedStores(@Param(Constants.WRAPPER) QueryWrapper<StoreInfoVo> queryWrapper);
|
|
|
|
|
|
|
+ "${ew.customSqlSegment} " +
|
|
|
|
|
+ "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 " +
|
|
|
|
|
+ "order by dist asc limit 20")
|
|
|
|
|
+ List<StoreInfoVo> getMoreRecommendedStores(@Param(Constants.WRAPPER) QueryWrapper<StoreInfoVo> queryWrapper, @Param("position") String position);
|
|
|
}
|
|
}
|