use of com.xiaocai.demo.excel.oracle.vo.TableInfo in project springboot-demo by small-rose.
the class SelectController method tableinfos.
@ApiOperation(value = "查表和表注释", response = Map.class)
@GetMapping("/tableinfos")
public Map tableinfos(String schema) {
if (StringUtils.isEmpty(schema)) {
schema = "PAYMT";
}
List<TableInfo> allTables = oracleSelectService.getAllTables(schema);
Map map = new HashMap(2);
map.put("code", "200");
map.put("data", allTables);
return map;
}
use of com.xiaocai.demo.excel.oracle.vo.TableInfo in project springboot-demo by small-rose.
the class ExcelFacadeService method addColumnInfos.
private void addColumnInfos(String schema, String fileName, List<TableInfo> allTables) {
if (allTables.isEmpty()) {
log.info(" allTables size is 0 ");
}
int index = 2;
for (TableInfo tableInfo : allTables) {
if (index == 4) {
break;
}
ExcelWriter excelWriter = EasyExcel.write(fileName, TableColumn.class).build();
List<TableColumn> columnInfos = oracleSelectService.getColumnInfo(schema, tableInfo.getTableName());
WriteSheet writeSheet = EasyExcel.writerSheet(index, tableInfo.getTableName()).head(TableColumn.class).build();
excelWriter.write(columnInfos, writeSheet);
excelWriter.finish();
index++;
}
System.out.println("=====执行完成=====");
}
Aggregations