@Override
    public DataResult<Dashboard> queryExistent(DashboardQueryParam param) {
        EasyLambdaQueryWrapper<DashboardDO> queryWrapper = new EasyLambdaQueryWrapper<>();
        queryWrapper
            .eq(DashboardDO::getDeleted, YesOrNoEnum.NO.getLetter())
            .eqWhenPresent(DashboardDO::getId, param.getId())
            .eqWhenPresent(DashboardDO::getUserId, param.getUserId());
        IPage<DashboardDO> page = getMapper().selectPage(new Page<>(1, 1), queryWrapper);
        if (CollectionUtils.isEmpty(page.getRecords())) {
            throw new DataNotFoundException();
        }
        Dashboard dashboardData = dashboardConverter.do2model(page.getRecords().get(0));
        LambdaQueryWrapper<DashboardChartRelationDO> dashboardChartRelationQueryWrapper = new LambdaQueryWrapper<>();
        dashboardChartRelationQueryWrapper.eq(DashboardChartRelationDO::getDashboardId, param.getId());
        List<DashboardChartRelationDO> relationDO = getMapper1().selectList(
            dashboardChartRelationQueryWrapper);
        List<Long> chartIds = relationDO.stream().map(DashboardChartRelationDO::getChartId).toList();
        dashboardData.setChartIds(chartIds);
        return DataResult.of(dashboardData);
    }
@author moji
@version DashboardServiceImpl.java, v 0.1 June 9, 2023 16:06 moji Exp $
@date 2023/06/09
chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/impl/DashboardServiceImpl.java