使用对象里面属性一样的组成新map集合

TableVo tableVo= AnalysisDruidSqlUtil.AnalysisSql(dto.getSqlInfo(),null);
List<MetaMappingInsideDto> metaMappingInsideDtos=new ArrayList<>();
List<TableMapVo> tableMapVos=tableVo.getTableMapVos();
Map<String, List<TableMapVo>> collect = tableMapVos.stream().collect(Collectors.groupingBy(v -> {
return v.getSourceTableName() +","+ v.getTargetTableName();
}));

list转string

qo.getDeptIds().stream().map(Objects::toString).collect(Collectors.joining(",")).toString();

根据对象属性过滤列表里面的属性过滤形成新集合

List<DataTablePermissionDo> tableTypes= dataTablePermissionService.findTableTypeListByQo(qo);

List<Person> personList = ... // 假设这是一个Person对象列表
Map<String, Person> personMap = personList.stream()
        .collect(Collectors.toMap(Person::getName, Function.identity()));

Map<Long, List<Integer>> dtypes = tableTypes.stream().collect(Collectors.groupingBy(DataTablePermissionDo::getMetaTableId,
Collectors.mapping(DataTablePermissionDo::getPermissionType,Collectors.toList())));
dataTablePermissions= dataTablePermissions.stream().collect(Collectors.filtering(tablePermissionDo -> {
List<Integer> dtypes1 = dtypes.get(tablePermissionDo.getMetaTableId());
boolean istrue=false;
if (dtypes1.contains(tablePermissionDo.getPermissionType())){
istrue=true;
}
return istrue;
},Collectors.toList()));

<trim prefix="AND (" prefixOverrides="OR" suffix=")">
<if test="deptIds != null and deptIds.size() > 0">
OR (
t.permission_object_type = 1
AND t.permission_object_id IN
<foreach collection="deptIds" item="deptId" open="(" close=")" separator=",">
#{deptId}
</foreach>
)
</if>

<if test="roleIds != null and roleIds.size() > 0">
OR (
t.permission_object_type = 2
AND t.permission_object_id IN
<foreach collection="roleIds" item="roleId" open="(" close=")" separator=",">
#{roleId}
</foreach>
)
</if>
<if test=" !spaceFiltering and projectIds != null and projectIds.size() > 0">
OR (
t.permission_object_type = 3
AND t.permission_object_id IN
<foreach collection="projectIds" item="projectId" open="(" close=")" separator=",">
#{projectId}
</foreach>
)
</if>
</trim>

Map<Long,String> tabbles=new HashMap<>();

tabbles= tableExtensionInsideDos.stream().collect(Collectors.toMap(TableExtensionInsideDo::getId,TableExtensionInsideDo::getTableName));

  • 7
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值