| | |
| | | if (Objects.isNull(communityId)) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | return communityService.getSuitableServiceCategories(communityId); |
| | | return communityService.getSuitableServiceCategories(communityId,this.getAreaCode()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页获取热门商家", response = ConvenientMerchantVO.class) |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/convenient/service-category/suitable") |
| | | R getSuitableServiceCategories(@RequestParam("communityId") Long communityId); |
| | | R getSuitableServiceCategories(@RequestParam("communityId") Long communityId,@RequestParam("areaCode")String areaCode); |
| | | |
| | | /** |
| | | * 获取该社区下的热门商家 |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/service-category/suitable") |
| | | public R getSuitableServiceCategories(@RequestParam("communityId") Long communityId) { |
| | | return convenientServiceCategoryService.getSuitableServiceCategories(communityId); |
| | | public R getSuitableServiceCategories(@RequestParam("communityId") Long communityId,@RequestParam("areaCode")String areaCode) { |
| | | return convenientServiceCategoryService.getSuitableServiceCategories(communityId,areaCode); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | List<ConvenientServiceCategoryVO> selectSuitableServiceCategories(@Param("communityId") Long communityId); |
| | | List<ConvenientServiceCategoryVO> selectSuitableServiceCategories(@Param("communityId") Long communityId,@Param("areaCode")String areaCode); |
| | | } |
| | |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R getSuitableServiceCategories(Long communityId); |
| | | R getSuitableServiceCategories(Long communityId,String areaCode); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R getSuitableServiceCategories(Long communityId) { |
| | | return R.ok(this.baseMapper.selectSuitableServiceCategories(communityId)); |
| | | public R getSuitableServiceCategories(Long communityId,String areaCode) { |
| | | return R.ok(this.baseMapper.selectSuitableServiceCategories(communityId,areaCode)); |
| | | } |
| | | } |
| | |
| | | FROM com_convenient_service_categories ccsc |
| | | INNER JOIN com_convenient_service_scope ccss ON ccsc.id = ccss.service_category_id |
| | | INNER JOIN com_convenient_merchants ccm ON ccss.merchant_id = ccm.id |
| | | WHERE ccsc.is_del = 0 AND ccm.is_del = 0 AND( ccm.community_id = ${communityId} or ccm.community_id =0) AND ccm.business_status = 1 GROUP BY ccsc.id ORDER BY ccsc.weight desc |
| | | WHERE ccsc.is_del = 0 AND ccm.is_del = 0 AND( ccm.community_id = ${communityId} or ccm.community_id =0) and ccsc.area_code = #{areaCode} AND ccm.business_status = 1 GROUP BY ccsc.id ORDER BY ccsc.weight desc |
| | | </select> |
| | | </mapper> |