|
@@ -376,19 +376,15 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
|
|
|
@Override
|
|
|
public List<AppCategory> getAllCategory(String id) {
|
|
|
- AppSite appSite = appSiteMapper.selectById(id);
|
|
|
List<AppCategory> appCategories = new ArrayList<>();
|
|
|
- if (appSite!=null &&StringUtils.isNotBlank(appSite.getCategoryId())){
|
|
|
- List<String> strings = new ArrayList<>();
|
|
|
- if (appSite.getCategoryId().indexOf(",")>0){
|
|
|
- strings = Arrays.asList(appSite.getCategoryId().split(","));
|
|
|
- }else {
|
|
|
- strings.add(appSite.getCategoryId());
|
|
|
- }
|
|
|
- appCategories = appCategoryMapper.selectList(Wrappers.<AppCategory>lambdaQuery()
|
|
|
- .eq(AppCategory::getStatus, 0).in(AppCategory::getId,strings)
|
|
|
- .eq(AppCategory::getDelFlag, 0));
|
|
|
- }
|
|
|
+ List<Object> objects = appSitePlaceMapper.selectObjs(Wrappers.<AppSitePlace>lambdaQuery()
|
|
|
+ .select(AppSitePlace::getCategoryId)
|
|
|
+ .eq(AppSitePlace::getSiteId, id)
|
|
|
+ .groupBy(AppSitePlace::getCategoryId));
|
|
|
+ if(null == objects || objects.isEmpty()) return appCategories;
|
|
|
+ appCategories = appCategoryMapper.selectList(Wrappers.<AppCategory>lambdaQuery()
|
|
|
+ .eq(AppCategory::getStatus, 0).in(AppCategory::getId,objects)
|
|
|
+ .eq(AppCategory::getDelFlag, 0));
|
|
|
return appCategories;
|
|
|
}
|
|
|
|