09041612:编写规则引擎要调用的接口
parent
0559ebb209
commit
f2e65ffd1f
|
@ -252,7 +252,7 @@ public class TableInfoController {
|
||||||
/**
|
/**
|
||||||
* 根据parentId向下查询出子表
|
* 根据parentId向下查询出子表
|
||||||
* @param id id
|
* @param id id
|
||||||
* @return 返回数据库结构列表
|
* @return 返回tableInfo列表
|
||||||
*/
|
*/
|
||||||
@PostMapping("/findTableIdByParentId/{id}")
|
@PostMapping("/findTableIdByParentId/{id}")
|
||||||
@Operation(summary = "根据parentId向下查询出子表" , description = "根据parentId向下查询出子表")
|
@Operation(summary = "根据parentId向下查询出子表" , description = "根据parentId向下查询出子表")
|
||||||
|
@ -264,16 +264,14 @@ public class TableInfoController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据parentId向下查询出子表
|
* 根据parentId向下查询出子表
|
||||||
* @param id id
|
* @param parentId id
|
||||||
* @return 返回表结构列表
|
* @return 返回表结构列表
|
||||||
*/
|
*/
|
||||||
@PostMapping("/findTableByStructure/{id}")
|
@PostMapping("/findTableByStructure/{parentId}")
|
||||||
@Operation(summary = "根据parentId向下查询出子表" , description = "根据parentId向下查询出子表")
|
@Operation(summary = "根据parentId向下查询出子表" , description = "根据parentId向下查询出子表")
|
||||||
public Result<List<Structure>> findTableByStructure(@PathVariable("id") Long id) {
|
public Result<List<Structure>> findTableByStructure(@PathVariable("parentId") Long parentId) {
|
||||||
List<Long> structureIds = tableInfoService.findTableIdByParentId(id);
|
List<Long> structureIds = structureService.findTableIdByStructureId(parentId);
|
||||||
List<TableInfo> tableInfoList=tableInfoService.listByIds(structureIds);
|
List<Structure> structureList=structureService.listByIds(structureIds);
|
||||||
List<Long> tableInfoIds=tableInfoList.stream().map(TableInfo::getId).collect(Collectors.toList());
|
|
||||||
List<Structure> structureList = structureService.listByIds(tableInfoIds);
|
|
||||||
return Result.success(structureList);
|
return Result.success(structureList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.source.domain.Structure;
|
import com.muyu.source.domain.Structure;
|
||||||
import com.muyu.source.mapper.StructureMapper;
|
import com.muyu.source.mapper.StructureMapper;
|
||||||
import com.muyu.source.service.StructureService;
|
import com.muyu.source.service.StructureService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class StructureServiceImpl extends ServiceImpl<StructureMapper, Structure> implements StructureService {
|
public class StructureServiceImpl extends ServiceImpl<StructureMapper, Structure> implements StructureService {
|
||||||
|
@Autowired
|
||||||
|
private StructureMapper structureMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Structure> findStructureList(Long id) {
|
public List<Structure> findStructureList(Long id) {
|
||||||
|
@ -28,5 +31,13 @@ public class StructureServiceImpl extends ServiceImpl<StructureMapper, Structure
|
||||||
List<Structure> list = this.list(structureLambdaQueryWrapper);
|
List<Structure> list = this.list(structureLambdaQueryWrapper);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Long> findTableIdByStructureId(Long parentId) {
|
||||||
|
List<Long> list = structureMapper.selectObjs(new LambdaQueryWrapper<>() {{
|
||||||
|
eq(Structure::getId, parentId);
|
||||||
|
}});
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,4 +11,5 @@ public interface StructureService extends IService<Structure> {
|
||||||
|
|
||||||
List<Structure> findStructurelistS(Integer id);
|
List<Structure> findStructurelistS(Integer id);
|
||||||
|
|
||||||
|
List<Long> findTableIdByStructureId(Long parentId);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue