09051706:优化资产展示的代码
parent
240a115e93
commit
ecfa553c98
|
@ -2,7 +2,13 @@
|
|||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AliAccessStaticViaInstance" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliArrayNamingShouldHaveBracket" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliDeprecation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliEqualsAvoidNull" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliLongLiteralsEndingWithLowercaseL" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliMissingOverrideAnnotation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliWrapperTypeEquality" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAbstractClassShouldStartWithAbstractNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidApacheBeanUtilsCopy" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
|
@ -57,5 +63,6 @@
|
|||
<inspection_tool class="AlibabaUnsupportedExceptionWithModifyAsList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUseQuietReferenceNotation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUseRightCaseForDateFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="MapOrSetKeyShouldOverrideHashCodeEquals" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
|
@ -66,5 +66,4 @@ public class DataValueController {
|
|||
List<DataValue> dataValueList = dataValueService.findTableValueByTableName(basicId, tableName);
|
||||
return Result.success(dataValueList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.muyu.source.mysql;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/**
|
||||
* @author Lenovo
|
||||
* @ Tool:IntelliJ IDEA
|
||||
* @ Author:CHX
|
||||
* @ Date:2024-09-05-15:09
|
||||
* @ Version:1.0
|
||||
* @ Description:线程 Callable 创建任务
|
||||
*/
|
||||
public class ThreadQuery implements Callable<List> {
|
||||
//查询条件 根据条件来定义该类的属性
|
||||
private String search;
|
||||
//当前页数
|
||||
private int pageNum;
|
||||
//每页查询多少条
|
||||
private int pageSize;
|
||||
//要查询的表名,也可以写死,也可以从前面传
|
||||
private String table;
|
||||
//每次分页查出来的数据
|
||||
private List page;
|
||||
|
||||
public ThreadQuery(int pageNum, int pageSize, String table){
|
||||
this.pageNum = pageNum;
|
||||
this.pageSize = pageSize;
|
||||
this.table = table;
|
||||
//分页查询数据库数据 查出对应的数据
|
||||
page = null;
|
||||
|
||||
}
|
||||
@Override
|
||||
public List call() throws Exception {
|
||||
return page;
|
||||
}
|
||||
}
|
|
@ -248,29 +248,6 @@ public class DataSourceServiceImpl extends ServiceImpl<DataSourceMapper, DataSou
|
|||
ps = conn.prepareStatement(SELECTFIELD+"WHERE \n" +
|
||||
"TABLE_SCHEMA = '" + databaseName + "' \n" +
|
||||
"AND TABLE_NAME = '" + table.getTableName() + "'");
|
||||
// ps = conn.prepareStatement(" SELECT " +
|
||||
// " COLUMN_NAME , " +
|
||||
// " COLUMN_COMMENT ," +
|
||||
// " CASE WHEN COLUMN_KEY = 'PRI' THEN '是' ELSE '否' END ," +
|
||||
// " CASE \n" +
|
||||
// " WHEN DATA_TYPE = 'int' THEN 'Integer' " +
|
||||
// " WHEN DATA_TYPE = 'bigint' THEN 'Long' " +
|
||||
// " WHEN DATA_TYPE = 'varchar' THEN 'String' " +
|
||||
// " WHEN DATA_TYPE = 'decimal' THEN 'BigDecimal' " +
|
||||
// " WHEN DATA_TYPE = 'tinyint' AND COLUMN_TYPE = 'tinyint(1)' THEN 'Boolean'" +
|
||||
// " ELSE DATA_TYPE \n" +
|
||||
// " END , " +
|
||||
// " DATA_TYPE , \n" +
|
||||
// " COLUMN_TYPE , \n" +
|
||||
// " CHARACTER_MAXIMUM_LENGTH , \n" +
|
||||
// " NUMERIC_SCALE , \n" +
|
||||
// " IS_NULLABLE , \n" +
|
||||
// " COLUMN_DEFAULT \n" +
|
||||
// "FROM INFORMATION_SCHEMA.COLUMNS WHERE \n" +
|
||||
// "TABLE_SCHEMA = '" + databaseName + "' \n" +
|
||||
// "AND TABLE_NAME = '" + table.getTableName() + "'");
|
||||
|
||||
|
||||
ResultSet resultSet = ps.executeQuery();
|
||||
while (resultSet.next()) {
|
||||
String columnName = String.valueOf(resultSet.getString(1));
|
||||
|
|
|
@ -57,7 +57,6 @@ public class DataValueServiceImpl extends ServiceImpl<DataValueMapper, DataValue
|
|||
String remarks =null;
|
||||
while (columns.next()){
|
||||
remarks = columns.getString("REMARKS");
|
||||
|
||||
}
|
||||
DataValue build = DataValue.builder()
|
||||
.key(metaData.getColumnName(i))
|
||||
|
@ -66,7 +65,6 @@ public class DataValueServiceImpl extends ServiceImpl<DataValueMapper, DataValue
|
|||
.type(DataType.convertTypeString(columnTypeName))
|
||||
.build();
|
||||
dataValueList.add(build);
|
||||
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
|
|
Loading…
Reference in New Issue