mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
添加查询标签数据源value接口
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.system.api.datasource;
|
||||
|
||||
import com.cf.imes.framework.common.exception.ErrorCode;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.module.system.api.dataSource.DataSourceApi;
|
||||
import com.cf.imes.module.system.dal.dataobject.datasource.DataSourceDO;
|
||||
import com.cf.imes.module.system.dal.mysql.datasource.DataSourceMapper;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
@RestController
|
||||
public class DataSourceApiImpl implements DataSourceApi {
|
||||
|
||||
@Resource
|
||||
private DataSourceMapper dataSourceMapper;
|
||||
|
||||
@Override
|
||||
public CommonResult<String> getSqlById(Long id) {
|
||||
DataSourceDO dataSourceDO = dataSourceMapper.selectById(id);
|
||||
if(Objects.isNull(dataSourceDO)) {
|
||||
throw exception(new ErrorCode(2133,"数据源不存在"));
|
||||
}
|
||||
return CommonResult.success(dataSourceDO.getSqlStr()) ;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class DataSourcePageReqVO extends PageParam {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "sql")
|
||||
private String sql;
|
||||
private String sqlStr;
|
||||
|
||||
@Schema(description = "数据源类型", example = "2")
|
||||
private Integer type;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ public class DataSourceRespVO {
|
||||
|
||||
@Schema(description = "sql", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("sql")
|
||||
private String sql;
|
||||
private String sqlStr;
|
||||
|
||||
@Schema(description = "数据源类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("数据源类型")
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class DataSourceDO extends BaseDO {
|
||||
/**
|
||||
* sql
|
||||
*/
|
||||
private String sql;
|
||||
private String sqlStr;
|
||||
/**
|
||||
* 数据源类型
|
||||
*/
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ public interface DataSourceMapper extends BaseMapperX<DataSourceDO> {
|
||||
default PageResult<DataSourceDO> selectPage(DataSourcePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DataSourceDO>()
|
||||
.likeIfPresent(DataSourceDO::getName, reqVO.getName())
|
||||
.eqIfPresent(DataSourceDO::getSql, reqVO.getSql())
|
||||
.eqIfPresent(DataSourceDO::getSqlStr, reqVO.getSqlStr())
|
||||
.eqIfPresent(DataSourceDO::getType, reqVO.getType())
|
||||
.betweenIfPresent(DataSourceDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DataSourceDO::getId));
|
||||
|
||||
Reference in New Issue
Block a user