mirror of
https://github.com/dataease/dataease.git
synced 2026-05-23 13:58:26 +08:00
refactor: 智能问数优化 (#17228)
This commit is contained in:
@@ -57,7 +57,6 @@ public interface DataSetAssistantMapper {
|
||||
left join `core_dataset_table` cdt on cdg.id = cdt.dataset_group_id
|
||||
left join `core_dataset_table_field` cdtf on cdtf.dataset_group_id = cdg.id and (cdtf.dataset_table_id is NULL or cdtf.dataset_table_id = cdt.id)
|
||||
inner join `core_datasource` cd on cdt.datasource_id = cd.id
|
||||
where cdg.is_cross != 1 and (cd.STATUS IS NULL OR cd.STATUS != 'Error')
|
||||
${ew.customSqlSegment}
|
||||
"""
|
||||
)
|
||||
@@ -120,8 +119,6 @@ public interface DataSetAssistantMapper {
|
||||
INNER JOIN `core_dataset_group` cdg ON cdg.id = cdt.dataset_group_id
|
||||
AND cdg.is_cross != 1
|
||||
INNER JOIN `core_dataset_table_field` cdtf ON cdtf.dataset_group_id = cdg.id and (cdtf.dataset_table_id is NULL or cdtf.dataset_table_id = cdt.id)
|
||||
where not exists( select 1 from user_ds_permissions ds_p where cd.id = ds_p.resource_id )
|
||||
and not exists( select 1 from user_dg_permissions dg_p where cdg.id = dg_p.resource_id )
|
||||
${ew.customSqlSegment}
|
||||
""")
|
||||
List<Map<String, Object>> queryCommunity(@Param("ew") QueryWrapper queryWrapper);
|
||||
|
||||
@@ -179,11 +179,17 @@ public class DatasetSQLBotManage {
|
||||
if (!isAdmin) {
|
||||
return null;
|
||||
}
|
||||
queryWrapper.eq("cdg.is_cross", 0)
|
||||
.and(wrapper -> wrapper.isNull("cd.STATUS").or().ne("cd.STATUS", "Error"));
|
||||
list = dataSetAssistantMapper.queryAll(queryWrapper);
|
||||
} else if (!model) {
|
||||
if (!isAdmin) {
|
||||
return null;
|
||||
}
|
||||
queryWrapper.apply("""
|
||||
not exists( select 1 from user_ds_permissions ds_p where cd.id = ds_p.resource_id )
|
||||
and not exists( select 1 from user_dg_permissions dg_p where cdg.id = dg_p.resource_id )
|
||||
""");
|
||||
list = dataSetAssistantMapper.queryCommunity(queryWrapper);
|
||||
} else {
|
||||
boolean isRootRole = isAdmin;
|
||||
|
||||
Reference in New Issue
Block a user