小程序主页接口

This commit is contained in:
张松
2025-03-07 14:35:44 +08:00
parent 4fb4863cb1
commit 8e601b65dd
6 changed files with 11 additions and 7 deletions

View File

@@ -41,5 +41,5 @@ public interface ProductMapper extends BaseMapper<Product> {
List<RecommendProVO> selectRecommendProductList(@Param("lng") String lng, @Param("lat") String lat, @Param("address") String address,
@Param("classify") Integer classify, @Param("orderType") Integer orderType,
@Param("distanceType") Integer distanceType);
@Param("distanceType") Integer distanceType, @Param("name") String name);
}

View File

@@ -106,8 +106,8 @@ public class HomePageServiceImpl implements HomePageService {
}
@Override
public Page<RecommendProVO> getProd(String lng, String lat, String address, Integer classify, Integer orderType, Integer distanceType) {
public Page<RecommendProVO> getProd(String lng, String lat, String address, Integer classify, Integer orderType, Integer distanceType, String name) {
PageHelper.startPage(PageUtil.buildPageHelp());
return PageUtil.convert(new PageInfo<>(productMapper.selectRecommendProductList(lng, lat, address, classify, orderType, distanceType)));
return PageUtil.convert(new PageInfo<>(productMapper.selectRecommendProductList(lng, lat, address, classify, orderType, distanceType, name)));
}
}

View File

@@ -173,6 +173,10 @@
<if test="address != null and address != ''">
and (b.cities like concat('%', #{address}, '%') or b.districts like concat('%', #{address}, '%'))
</if>
<if test="name != null and name != ''">
and a.name like concat('%', #{name}, '%')
</if>
<if test="classify != null">
and c.category_id = #{classify}
</if>