59 lines
2.0 KiB
Java
59 lines
2.0 KiB
Java
package com.muyu.source.controller;
|
||
|
||
import com.muyu.common.core.domain.Result;
|
||
import com.muyu.source.core.DataValue;
|
||
import com.muyu.source.domain.model.DataValueModel;
|
||
import com.muyu.source.service.DataValueService;
|
||
import io.swagger.v3.oas.annotations.Operation;
|
||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.web.bind.annotation.*;
|
||
|
||
import java.util.List;
|
||
|
||
/**
|
||
* @author Lenovo
|
||
* @ Tool:IntelliJ IDEA
|
||
* @ Author:CHX
|
||
* @ Date:2024-08-30-21:37
|
||
* @ Version:1.0
|
||
* @ Description:资产展示控制层
|
||
*/
|
||
@RestController
|
||
@RequestMapping("/value")
|
||
@Tag(name = "资产展示控制层", description = "进行资产展示的相关操作")
|
||
public class DataValueController {
|
||
|
||
@Autowired
|
||
private DataValueService dataValueService;
|
||
|
||
/**
|
||
* 根据基础表ID和SQL语句查询数据
|
||
*
|
||
* @param basicId 基础表ID
|
||
* @param sql SQL语句
|
||
* @return DataValue{kltv}
|
||
*/
|
||
@PostMapping("/findTableValue")
|
||
@Operation(summary = "根据基础表ID和SQL语句查询数据", description = "根据基础表ID和SQL语句查询数据")
|
||
public Result findTableValue(@RequestBody DataValueModel dataValueModel) {
|
||
List<DataValue> dataValueList = dataValueService.findTableValue(dataValueModel);
|
||
return Result.success(dataValueList);
|
||
}
|
||
|
||
/**
|
||
* 根据基础表ID和表名查询数据
|
||
*
|
||
* @param basicId 基础表ID
|
||
* @param tableName 表名
|
||
* @return DataValue{kltv}
|
||
*/
|
||
@PostMapping("/findTableValueByTableName")
|
||
@Operation(summary = "根据基础表ID和SQL语句查询数据", description = "根据基础表ID和SQL语句查询数据")
|
||
public Result findTableValueByTableName(@RequestParam("basicId") Long basicId, @RequestParam("tableName") String tableName) {
|
||
List<DataValue> dataValueList = dataValueService.findTableValueByTableName(basicId, tableName);
|
||
return Result.success(dataValueList);
|
||
}
|
||
|
||
}
|