Skip to content

Commit 5e68763

Browse files
committed
[1.3_beta][taier-all] remove datasource tenant quarantine
1 parent a17f792 commit 5e68763

File tree

7 files changed

+29
-117
lines changed

7 files changed

+29
-117
lines changed

sql/1.3/1.3_increment.sql

Lines changed: 17 additions & 2 deletions
Large diffs are not rendered by default.

sql/init.sql

Lines changed: 2 additions & 18 deletions
Large diffs are not rendered by default.

taier-dao/src/main/java/com/dtstack/taier/dao/mapper/DsInfoMapper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,4 @@ public interface DsInfoMapper extends com.baomidou.mybatisplus.core.mapper.BaseM
9090
*/
9191
void updateDataTypeByDataTypeCode(@Param("dataType") String dataType,@Param("dataVersion") String dataVersion, @Param("dataTypeCode") Integer dataTypeCode);
9292

93-
94-
List<DsInfo> queryByTenantId(Long tenantId);
9593
}

taier-dao/src/main/resources/sqlmap/DsInfoMapper.xml

Lines changed: 3 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -33,78 +33,12 @@
3333
a.data_type_code as dataTypeCode
3434
</sql>
3535

36-
<sql id="queryImportDsSql">
37-
<where>
38-
a.is_deleted = 0
39-
and b.is_deleted = 0
40-
and b.`app_type` = #{listQuery.appType}
41-
and a.`tenant_id` = #{listQuery.tenant_id}
42-
<if test="listQuery.dataTypeList != null and listQuery.dataTypeList.size() > 0">
43-
and a.`data_type` in
44-
<foreach collection="listQuery.dataTypeList" item="dataType" open="(" separator="," close=")">
45-
#{dataType}
46-
</foreach>
47-
</if>
48-
<if test="listQuery.dataTypeCodeList != null and listQuery.dataTypeCodeList.size() > 0">
49-
and a.data_type_code in
50-
<foreach collection="listQuery.dataTypeCodeList" item="dataTypeCode" open="(" separator="," close=")">
51-
#{dataTypeCode}
52-
</foreach>
53-
</if>
54-
<if test="listQuery.search != null and listQuery.search != ''">
55-
and (
56-
a.data_name like concat('%', #{listQuery.search} ,'%')
57-
or a.data_desc like concat('%', #{listQuery.search}, '%')
58-
)
59-
</if>
60-
and not EXISTS (
61-
select data_info_id
62-
FROM dsc_import_ref t
63-
WHERE a.id = t.data_info_id
64-
and t.is_deleted = 0
65-
and t.app_type = #{listQuery.appType}
66-
and t.tenant_id = #{listQuery.tenantId}
67-
)
68-
</where>
69-
</sql>
70-
71-
<sql id="queryAppDsSql">
72-
<where>
73-
a.is_deleted = 0
74-
and b.is_deleted = 0
75-
and b.`app_type` = #{listQuery.appType}
76-
and a.`tenant_id` = #{listQuery.tenantId}
77-
<if test="listQuery.dataName !=null and listQuery.dataName !=''">
78-
and a.data_name = #{listQuery.dataName}
79-
</if>
80-
<if test="listQuery.isMeta !=null ">
81-
and a.is_meta = #{listQuery.isMeta}
82-
</if>
83-
<if test="listQuery.dataTypeCodeList !=null and listQuery.dataTypeCodeList.size()>0">
84-
and a.`data_type_code` in
85-
<foreach collection="listQuery.dataTypeCodeList" item="dataTypeCode" open="(" separator="," close=")">
86-
#{dataTypeCode}
87-
</foreach>
88-
</if>
89-
<if test="listQuery.schemaNameList !=null and listQuery.schemaNameList.size()>0 ">
90-
and a.`schema_name` in
91-
<foreach collection="listQuery.schemaNameList" item="schemaName" open="(" separator="," close=")">
92-
#{schemaName}
93-
</foreach>
94-
</if>
95-
<if test="listQuery.search != null and listQuery.search != ''">
96-
and (
97-
a.data_name like concat('%', #{listQuery.search} ,'%')
98-
or a.data_desc like concat('%', #{listQuery.search}, '%')
99-
)
100-
</if>
101-
</where>
102-
</sql>
103-
10436
<sql id="queryDsSql">
10537
<where>
10638
a.is_deleted = 0
107-
and a.tenant_id = #{listQuery.tenantId}
39+
<if test="listQuery.tenantId != null and listQuery.tenantId != ''">
40+
and a.tenant_id = #{listQuery.tenantId}
41+
</if>
10842
<if test="listQuery.search != null and listQuery.search != ''">
10943
and (
11044
a.data_name like concat('%', #{listQuery.search} ,'%')
@@ -240,13 +174,5 @@
240174
</if>
241175
</select>
242176

243-
<select id="queryByTenantId" resultType="com.dtstack.taier.dao.domain.DsInfo">
244-
select
245-
<include refid="select_content_fragment" />
246-
from datasource_info a
247-
where a.tenant_id = #{tenantId}
248-
and is_deleted = 0
249-
and status = 1;
250-
</select>
251177

252178
</mapper>

taier-data-develop/src/main/java/com/dtstack/taier/develop/controller/datasource/DataSourceController.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ public class DataSourceController {
8484
@ApiOperation("数据源列表分页信息")
8585
@PostMapping("page")
8686
public R<PageResult<List<DsListVO>>> dsPage(@RequestBody DsListParam dsListParam) {
87-
87+
dsListParam.setTenantId(null);
8888
return R.ok(dsInfoService.dsPage(dsListParam));
8989
}
9090

9191
@ApiOperation("数据源列表总信息")
92-
@PostMapping("total")
92+
@PostMapping(value = "total")
9393
public R<List<DsListVO>> total(@RequestBody DsListParam dsListParam) {
94-
94+
dsListParam.setTenantId(null);
9595
return R.ok(dsInfoService.total(dsListParam));
9696
}
9797

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

129129

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

136137
@ApiOperation("根据租户id查询数据源列表")

taier-data-develop/src/main/java/com/dtstack/taier/develop/mapstruct/datasource/DsTypeTransfer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ public interface DsTypeTransfer {
3737
@Mapping(source = "id",target = "typeId")
3838
DsTypeVO toInfoVO(DsType dsType);
3939

40-
List<DsTypeVO> toInfoVOs(List<DsType> dsTypeList);
41-
4240
List<DsTypeListVO> toDsTypeListVOs(List<DsType> dsTypeList);
4341

4442

taier-data-develop/src/main/java/com/dtstack/taier/develop/service/datasource/impl/DsInfoService.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -555,16 +555,6 @@ public Boolean checkDataNameDup(DsInfo dsInfo) {
555555
return CollectionUtils.isNotEmpty(dsInfoList);
556556
}
557557

558-
/**
559-
* 根据租户查询数据源列表
560-
*
561-
* @param tenantId
562-
* @return
563-
*/
564-
public List<DsInfoVO> queryByTenantId(Long tenantId) {
565-
List<DsInfo> dsInfos = dsInfoMapper.queryByTenantId(tenantId);
566-
return DsListTransfer.INSTANCE.toDsInfoVOS(dsInfos);
567-
}
568558

569559
/**
570560
* 查询数据源基本信息

0 commit comments

Comments
 (0)