use of com.xiaocai.demo.excel.oracle.vo.TableColumn in project springboot-demo by small-rose.
the class SelectController method columninfos.
@ApiOperation(value = "查表的列、类型、列注释", response = Map.class)
@GetMapping("/columninfos")
public Map columninfos(String schema, String tableName) {
if (StringUtils.isEmpty(schema)) {
schema = "PAYMT";
}
if (StringUtils.isEmpty(tableName)) {
tableName = "T_APPLICATIONS";
}
List<TableColumn> columnInfos = oracleSelectService.getColumnInfo(schema, tableName);
Map map = new HashMap(2);
map.put("code", "200");
map.put("data", columnInfos);
return map;
}
use of com.xiaocai.demo.excel.oracle.vo.TableColumn 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