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));