09041214:编写规则引擎要调用的接口
parent
0c71f5add7
commit
68df926995
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue