Skip to content

Commit

Permalink
[1.3_beta][taier-all] remove datasource tenant quarantine
Browse files Browse the repository at this point in the history
  • Loading branch information
vainhope committed Nov 2, 2022
1 parent a17f792 commit 5e68763
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 117 deletions.
19 changes: 17 additions & 2 deletions sql/1.3/1.3_increment.sql

Large diffs are not rendered by default.

20 changes: 2 additions & 18 deletions sql/init.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,4 @@ public interface DsInfoMapper extends com.baomidou.mybatisplus.core.mapper.BaseM
*/
void updateDataTypeByDataTypeCode(@Param("dataType") String dataType,@Param("dataVersion") String dataVersion, @Param("dataTypeCode") Integer dataTypeCode);


List<DsInfo> queryByTenantId(Long tenantId);
}
80 changes: 3 additions & 77 deletions taier-dao/src/main/resources/sqlmap/DsInfoMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,78 +33,12 @@
a.data_type_code as dataTypeCode
</sql>

<sql id="queryImportDsSql">
<where>
a.is_deleted = 0
and b.is_deleted = 0
and b.`app_type` = #{listQuery.appType}
and a.`tenant_id` = #{listQuery.tenant_id}
<if test="listQuery.dataTypeList != null and listQuery.dataTypeList.size() > 0">
and a.`data_type` in
<foreach collection="listQuery.dataTypeList" item="dataType" open="(" separator="," close=")">
#{dataType}
</foreach>
</if>
<if test="listQuery.dataTypeCodeList != null and listQuery.dataTypeCodeList.size() > 0">
and a.data_type_code in
<foreach collection="listQuery.dataTypeCodeList" item="dataTypeCode" open="(" separator="," close=")">
#{dataTypeCode}
</foreach>
</if>
<if test="listQuery.search != null and listQuery.search != ''">
and (
a.data_name like concat('%', #{listQuery.search} ,'%')
or a.data_desc like concat('%', #{listQuery.search}, '%')
)
</if>
and not EXISTS (
select data_info_id
FROM dsc_import_ref t
WHERE a.id = t.data_info_id
and t.is_deleted = 0
and t.app_type = #{listQuery.appType}
and t.tenant_id = #{listQuery.tenantId}
)
</where>
</sql>

<sql id="queryAppDsSql">
<where>
a.is_deleted = 0
and b.is_deleted = 0
and b.`app_type` = #{listQuery.appType}
and a.`tenant_id` = #{listQuery.tenantId}
<if test="listQuery.dataName !=null and listQuery.dataName !=''">
and a.data_name = #{listQuery.dataName}
</if>
<if test="listQuery.isMeta !=null ">
and a.is_meta = #{listQuery.isMeta}
</if>
<if test="listQuery.dataTypeCodeList !=null and listQuery.dataTypeCodeList.size()>0">
and a.`data_type_code` in
<foreach collection="listQuery.dataTypeCodeList" item="dataTypeCode" open="(" separator="," close=")">
#{dataTypeCode}
</foreach>
</if>
<if test="listQuery.schemaNameList !=null and listQuery.schemaNameList.size()>0 ">
and a.`schema_name` in
<foreach collection="listQuery.schemaNameList" item="schemaName" open="(" separator="," close=")">
#{schemaName}
</foreach>
</if>
<if test="listQuery.search != null and listQuery.search != ''">
and (
a.data_name like concat('%', #{listQuery.search} ,'%')
or a.data_desc like concat('%', #{listQuery.search}, '%')
)
</if>
</where>
</sql>

<sql id="queryDsSql">
<where>
a.is_deleted = 0
and a.tenant_id = #{listQuery.tenantId}
<if test="listQuery.tenantId != null and listQuery.tenantId != ''">
and a.tenant_id = #{listQuery.tenantId}
</if>
<if test="listQuery.search != null and listQuery.search != ''">
and (
a.data_name like concat('%', #{listQuery.search} ,'%')
Expand Down Expand Up @@ -240,13 +174,5 @@
</if>
</select>

<select id="queryByTenantId" resultType="com.dtstack.taier.dao.domain.DsInfo">
select
<include refid="select_content_fragment" />
from datasource_info a
where a.tenant_id = #{tenantId}
and is_deleted = 0
and status = 1;
</select>

</mapper>
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ public class DataSourceController {
@ApiOperation("数据源列表分页信息")
@PostMapping("page")
public R<PageResult<List<DsListVO>>> dsPage(@RequestBody DsListParam dsListParam) {

dsListParam.setTenantId(null);
return R.ok(dsInfoService.dsPage(dsListParam));
}

@ApiOperation("数据源列表总信息")
@PostMapping("total")
@PostMapping(value = "total")
public R<List<DsListVO>> total(@RequestBody DsListParam dsListParam) {

dsListParam.setTenantId(null);
return R.ok(dsInfoService.total(dsListParam));
}

Expand Down Expand Up @@ -128,9 +128,10 @@ public R<List<DsTypeListVO>> dsTypeList() {


@ApiOperation("根据租户id查询数据源列表")
@GetMapping("queryByTenantId")
public R<List<DsInfoVO>> queryByTenantId(@RequestParam("tenantId") Long tenantId) {
return R.ok(dsInfoService.queryByTenantId(tenantId));
@GetMapping("total")
public R<List<DsListVO>> total() {
List<DsListVO> total = dsInfoService.total(new DsListParam());
return R.ok(total);
}

@ApiOperation("根据租户id查询数据源列表")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public interface DsTypeTransfer {
@Mapping(source = "id",target = "typeId")
DsTypeVO toInfoVO(DsType dsType);

List<DsTypeVO> toInfoVOs(List<DsType> dsTypeList);

List<DsTypeListVO> toDsTypeListVOs(List<DsType> dsTypeList);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,16 +555,6 @@ public Boolean checkDataNameDup(DsInfo dsInfo) {
return CollectionUtils.isNotEmpty(dsInfoList);
}

/**
* 根据租户查询数据源列表
*
* @param tenantId
* @return
*/
public List<DsInfoVO> queryByTenantId(Long tenantId) {
List<DsInfo> dsInfos = dsInfoMapper.queryByTenantId(tenantId);
return DsListTransfer.INSTANCE.toDsInfoVOS(dsInfos);
}

/**
* 查询数据源基本信息
Expand Down

0 comments on commit 5e68763

Please sign in to comment.