报表模块mycat环境无法路由修复

This commit is contained in:
gaoqr
2026-05-15 17:14:40 +08:00
parent 3cc76015a8
commit dd134616bd
@@ -10,6 +10,8 @@ import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.CF_ORGANID;
/** /**
* 报表数据源 Mapper * 报表数据源 Mapper
* *
@@ -30,10 +32,14 @@ public interface ReportDatasourceMapper extends BaseMapperX<ReportDatasourceDO>
default ReportDatasourceDO selectNormalDatasourceById(Long id, Long organId) { default ReportDatasourceDO selectNormalDatasourceById(Long id, Long organId) {
LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<ReportDatasourceDO>() LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<ReportDatasourceDO>()
.eq(ReportDatasourceDO::getId, id) .eq(ReportDatasourceDO::getId, id)
.and(wr -> wr.or(wrapper -> wrapper .and(wr -> wr
.or(wrapper -> wrapper
.eq(ReportDatasourceDO::getOrganId, organId) .eq(ReportDatasourceDO::getOrganId, organId)
.eq(ReportDatasourceDO::getBuildinType, ReportTemplateTypeEnum.CUSTOM)) .eq(ReportDatasourceDO::getBuildinType, ReportTemplateTypeEnum.CUSTOM))
.or(wrapper -> wrapper.eq(ReportDatasourceDO::getBuildinType, ReportTemplateTypeEnum.SYSTEM))); .or(wrapper -> wrapper
.eq(ReportDatasourceDO::getOrganId, 1L)
.eq(ReportDatasourceDO::getBuildinType, ReportTemplateTypeEnum.SYSTEM))
);
return selectOne(queryWrapper); return selectOne(queryWrapper);
} }
@@ -50,7 +56,9 @@ public interface ReportDatasourceMapper extends BaseMapperX<ReportDatasourceDO>
.and(wr -> wr.or(wrapper -> wrapper .and(wr -> wr.or(wrapper -> wrapper
.eq(ReportDatasourceDO::getOrganId, organId) .eq(ReportDatasourceDO::getOrganId, organId)
.eq(ReportDatasourceDO::getBuildinType, ReportTemplateTypeEnum.CUSTOM)) .eq(ReportDatasourceDO::getBuildinType, ReportTemplateTypeEnum.CUSTOM))
.or(wrapper -> wrapper.eq(ReportDatasourceDO::getBuildinType, ReportTemplateTypeEnum.SYSTEM))); .or(wrapper -> wrapper
.eq(ReportDatasourceDO::getOrganId, CF_ORGANID)
.eq(ReportDatasourceDO::getBuildinType, ReportTemplateTypeEnum.SYSTEM)));
return selectList(queryWrapper); return selectList(queryWrapper);
} }
} }