@Override
    public DataResult<Chart> queryExistent(ChartQueryParam param) {
        EasyLambdaQueryWrapper<ChartDO> queryWrapper = new EasyLambdaQueryWrapper<>();
        queryWrapper
            .eq(ChartDO::getDeleted, YesOrNoEnum.NO.getLetter())
            .eqWhenPresent(ChartDO::getId, param.getId())
            .eqWhenPresent(ChartDO::getUserId, param.getUserId());
        IPage<ChartDO> page = getMapper().selectPage(new Page<>(1, 1), queryWrapper);
        if (CollectionUtils.isEmpty(page.getRecords())) {
            throw new DataNotFoundException();
        }
        Chart data = chartConverter.do2model(page.getRecords().get(0));
        setDataSourceInfo(Lists.newArrayList(data));
        return DataResult.of(data);
    }
@author moji
@version ChartServiceImpl.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/ChartServiceImpl.java