优化店铺分类查询
This commit is contained in:
parent
02020d31a5
commit
da97c93e9f
@ -3007,7 +3007,20 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
params.put("countyId", countyId);
|
||||
params.put("userLng", userLng);
|
||||
params.put("userLat", userLat);
|
||||
params.put("storeCategoryId", storeCategoryId);
|
||||
List<Integer> storeCategoryIds=new ArrayList<>();
|
||||
QueryWrapper<ShopBaseStoreCategory> storeCategoryQueryWrapper = new QueryWrapper<>();
|
||||
storeCategoryQueryWrapper.eq("store_category_parent_id",storeCategoryId);
|
||||
List<ShopBaseStoreCategory> shopBaseStoreCategories= shopBaseStoreCategoryService.list(storeCategoryQueryWrapper);
|
||||
if(!shopBaseStoreCategories.isEmpty()){
|
||||
storeCategoryIds.add(storeCategoryId);
|
||||
shopBaseStoreCategories.forEach(shopBaseStoreCategory -> {
|
||||
storeCategoryIds.add(shopBaseStoreCategory.getStore_category_id());
|
||||
});
|
||||
params.put("storeCategoryIds", storeCategoryIds);
|
||||
}else {
|
||||
params.put("storeCategoryId", storeCategoryId);
|
||||
}
|
||||
|
||||
params.put("subSiteId", subSiteId);
|
||||
params.put("storeName", storeName);
|
||||
|
||||
|
||||
@ -131,6 +131,12 @@
|
||||
<if test="params.storeCategoryId!=null">
|
||||
and b.store_category_id=#{params.storeCategoryId}
|
||||
</if>
|
||||
<if test="params.storeCategoryIds!=null">
|
||||
and b.store_category_id in
|
||||
<foreach collection="params.storeCategoryIds" item="storeCategoryId" separator="," open="(" close=")">
|
||||
#{storeCategoryId}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="params.subSiteId!=null">
|
||||
and b.subsite_id=#{params.subSiteId}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user