小程序主页接口
This commit is contained in:
@@ -42,7 +42,7 @@ public class HomeController {
|
||||
* @return 商品列表
|
||||
*/
|
||||
@GetMapping("/product")
|
||||
public CzgResult<Page<RecommendProVO>> home(String lng, String lat, String address, Integer categoryId, Integer orderType, Integer distanceType) {
|
||||
return CzgResult.success(homePageService.getProd(lng, lat, address, categoryId, orderType, distanceType));
|
||||
public CzgResult<Page<RecommendProVO>> home(String lng, String lat, String address, Integer categoryId, Integer orderType, Integer distanceType, String name) {
|
||||
return CzgResult.success(homePageService.getProd(lng, lat, address, categoryId, orderType, distanceType, name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PrinterEditDTO {
|
||||
/**
|
||||
* 打印机品牌
|
||||
*/
|
||||
@Size(min = 1, message = "打印机品牌不为空")
|
||||
// @Size(min = 1, message = "打印机品牌不为空")
|
||||
private String contentType;
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,6 @@ import com.mybatisflex.core.paginate.Page;
|
||||
public interface HomePageService {
|
||||
HomePageVO getHomeInfo();
|
||||
|
||||
Page<RecommendProVO> getProd(String lng, String lat, String address, Integer classify, Integer orderType, Integer distanceType);
|
||||
Page<RecommendProVO> getProd(String lng, String lat, String address, Integer classify, Integer orderType, Integer distanceType, String name);
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user