fine:()类型转换
parent
f50f85502f
commit
725f1d3d1c
|
@ -66,8 +66,12 @@ public class DataRunNameController {
|
|||
*/
|
||||
@PostMapping("/findTableValue")
|
||||
@Operation(summary = "获取数据库名",description = "返回所有数据库以及所有表的结果集")
|
||||
public Result<List<DataValue>> findTableValue(@RequestParam(name = "basicId") String basicId,@RequestParam(name = "dataId") String dataId){
|
||||
public Result<List<DataValue>> findTableValue(
|
||||
@RequestParam(name = "basicId") String basicId,
|
||||
@RequestParam(name = "dataId") String dataId,
|
||||
@RequestParam(name = "tableName") String tableName
|
||||
){
|
||||
|
||||
return Result.success(dataRunNameService.findTableValue(basicId,dataId));
|
||||
return Result.success(dataRunNameService.findTableValue(basicId,dataId,tableName));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,5 +38,5 @@ public interface DataRunNameService {
|
|||
* @param basicId 数据类型转换ID
|
||||
* @return 返回结果
|
||||
*/
|
||||
List<DataValue> findTableValue(String basicId, String dataId);
|
||||
List<DataValue> findTableValue(String basicId, String dataId,String tableName);
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ public class DataRunNameServiceImpl implements DataRunNameService {
|
|||
* @return 返回结果
|
||||
*/
|
||||
@Override
|
||||
public List<DataValue> findTableValue(String basicId, String dataId) {
|
||||
public List<DataValue> findTableValue(String basicId, String dataId,String tableName) {
|
||||
DataName byId = dataNameService.getById(dataId);
|
||||
MySqlQuery mySqlQuery = new MySqlQuery();
|
||||
mySqlQuery.setDataSourceId(String.valueOf(basicId));
|
||||
|
@ -167,7 +167,7 @@ public class DataRunNameServiceImpl implements DataRunNameService {
|
|||
List<DataValue> list = new ArrayList<>();
|
||||
|
||||
try {
|
||||
PreparedStatement preparedStatement = conn.prepareStatement("select field,type,annotation FROM tablefie WHERE table_id="+basicId);
|
||||
PreparedStatement preparedStatement = conn.prepareStatement("select field,type,annotation FROM "+tableName+" WHERE table_id="+basicId);
|
||||
|
||||
ResultSet resultSet = preparedStatement.executeQuery();
|
||||
ResultSetMetaData metaData = resultSet.getMetaData();
|
||||
|
|
Loading…
Reference in New Issue