列表字段更改

This commit is contained in:
zhangchenbiao
2023-06-21 10:57:05 +08:00
parent 60315342d5
commit 349695b0c5
6 changed files with 75 additions and 46 deletions

View File

@@ -6,13 +6,17 @@ import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
@@ -85,6 +89,14 @@ public class HyOpenAreaInfoDAO {
return hyOpenAreaInfoMapper.selectByIds(ids);
}
public Map<Long, String> selectNameMapByIds(List<Long> ids){
if (CollectionUtils.isEmpty(ids)){
return Maps.newHashMap();
}
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOS = hyOpenAreaInfoMapper.selectByIds(ids);
return ListUtils.emptyIfNull(hyOpenAreaInfoDOS).stream().collect(Collectors.toMap(k->k.getId(), v->v.getAreaName()));
}
public HyOpenAreaInfoDO selectById(Long id){
if (id==null){