09041214:编写规则引擎要调用的接口

master
冷调 2024-09-04 12:15:08 +08:00
parent 0c71f5add7
commit 68df926995
3 changed files with 9 additions and 9 deletions

View File

@ -236,13 +236,12 @@ public class TableInfoController {
/** /**
* *
* parentId * parentId
* @param parentId id
* @return * @return
*/ */
@PostMapping("/selectById") @PostMapping("/selectById")
@Operation(summary = "根据parentId查询数据接入" , description = "根据parentId查询数据接入") @Operation(summary = "根据parentId查询数据接入" , description = "根据parentId查询数据接入")
public Result<List<TableInfo>> selectById(@RequestParam("parentId") Long parentId){ public Result<List<TableInfo>> selectById(){
List<TableInfo> tableInfo =tableInfoService.selectById(parentId); List<TableInfo> tableInfo =tableInfoService.selectById();
return Result.success(tableInfo); return Result.success(tableInfo);
} }
@ -254,11 +253,8 @@ public class TableInfoController {
@PostMapping("/findTableIdByParentId/{id}") @PostMapping("/findTableIdByParentId/{id}")
@Operation(summary = "根据parentId向下查询出子表" , description = "根据parentId向下查询出子表") @Operation(summary = "根据parentId向下查询出子表" , description = "根据parentId向下查询出子表")
public Result<List<TableInfo>> findTableIdByParentId(@PathVariable("id") Long id) { public Result<List<TableInfo>> findTableIdByParentId(@PathVariable("id") Long id) {
List<TableInfo> tableInfoList = null;
List<Long> structureIds = tableInfoService.findTableIdByParentId(id); List<Long> structureIds = tableInfoService.findTableIdByParentId(id);
for (Long structureId : structureIds) { List<TableInfo> tableInfoList=tableInfoService.listByIds(structureIds);
tableInfoList = tableInfoService.selectById(structureId);
}
return Result.success(tableInfoList); return Result.success(tableInfoList);
} }
} }

View File

@ -67,11 +67,13 @@ public class TableServiceImpl extends ServiceImpl<TableInfoMapper, TableInfo> im
} }
@Override @Override
public List<TableInfo> selectById(Long parentId) { public List<TableInfo> selectById() {
LambdaQueryWrapper<TableInfo> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TableInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TableInfo::getParentId, 0); queryWrapper.eq(TableInfo::getParentId, 0);
List<TableInfo> tableInfoList = tableInfoMapper.selectList(queryWrapper); List<TableInfo> tableInfoList = tableInfoMapper.selectList(queryWrapper);
return tableInfoList; return tableInfoList;
} }
} }

View File

@ -42,5 +42,7 @@ public interface TableInfoService extends IService<TableInfo> {
*/ */
List<Long> findTableIdByParentId(Long basicId); List<Long> findTableIdByParentId(Long basicId);
List<TableInfo> selectById(Long parentId); List<TableInfo> selectById();
} }