查询优化升级

This commit is contained in:
Binlin B Wang 2022-07-31 22:27:03 +08:00
parent 1feca37cd4
commit 92e0f136bf
3 changed files with 27 additions and 5 deletions

View File

@ -135,7 +135,7 @@ public class TopSearchTableController extends EBTSController {
* 导入表结构保存 * 导入表结构保存
*/ */
@PreAuthorize("@ebts.hasPermi('tool:table:import')") @PreAuthorize("@ebts.hasPermi('tool:table:import')")
@Log(title = "代码生成", businessType = BusinessType.IMPORT) @Log(title = "top表数据维护", businessType = BusinessType.IMPORT)
@PostMapping("/importTopTable") @PostMapping("/importTopTable")
public Result<String> importTableSave(String tables) { public Result<String> importTableSave(String tables) {
String[] tableNames = Convert.toStrArray(tables); String[] tableNames = Convert.toStrArray(tables);

View File

@ -10,11 +10,23 @@ public class UniColumnInfo {
private long queryId; private long queryId;
private String prop; private String prop;
private String label; private String label;
private String dictType;
public UniColumnInfo() { public UniColumnInfo() {
} }
public UniColumnInfo(long queryId,String prop, String label) { public UniColumnInfo(long queryId, String prop, String label, String dictType) {
this.dictType = dictType;
this.queryId = queryId;
if (StringUtils.isNull(label)){
this.label = prop;
}else {
this.label = label;
}
this.prop = prop;
}
public UniColumnInfo(long queryId, String prop, String label) {
this.queryId = queryId; this.queryId = queryId;
if (StringUtils.isNull(label)){ if (StringUtils.isNull(label)){
this.label = prop; this.label = prop;
@ -47,4 +59,12 @@ public class UniColumnInfo {
public void setLabel(String label) { public void setLabel(String label) {
this.label = label; this.label = label;
} }
public String getDictType() {
return dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
} }

View File

@ -23,6 +23,7 @@ import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* top万能查询主Service业务层处理 * top万能查询主Service业务层处理
@ -168,9 +169,10 @@ public class TopSearchTableServiceImpl implements TopSearchTableService {
int row = topSearchTableDao.insertTopSearchTable(table); int row = topSearchTableDao.insertTopSearchTable(table);
if (row > 0) { if (row > 0) {
List<TopSearchColumn> searchColumns = topSearchTableDao.selectDbTableColumnsByName(tableName); List<TopSearchColumn> searchColumns = topSearchTableDao.selectDbTableColumnsByName(tableName);
for (TopSearchColumn searchColumn : searchColumns) { searchColumns = searchColumns.stream().peek(column->{
searchColumn.setSearchTableId(table.getId()); column.setSearchTableId(table.getId());
} column.setIsUse(1);
}).collect(Collectors.toList());
if (searchColumns.size() > 0) { if (searchColumns.size() > 0) {
topSearchTableDao.batchTopSearchColumn(searchColumns); topSearchTableDao.batchTopSearchColumn(searchColumns);
} }