@Override
    public DataResult<Operation> queryExistent(OperationQueryParam param) {
        EasyLambdaQueryWrapper<OperationSavedDO> queryWrapper = new EasyLambdaQueryWrapper<>();
        queryWrapper.eqWhenPresent(OperationSavedDO::getId, param.getId())
            .eqWhenPresent(OperationSavedDO::getUserId, param.getUserId());
        IPage<OperationSavedDO> page = getMapper().selectPage(new Page<>(1, 1), queryWrapper);
        if (CollectionUtils.isEmpty(page.getRecords())) {
            throw new DataNotFoundException();
        }
        return DataResult.of(operationConverter.do2dto(page.getRecords().get(0)));
    }
@author moji
@version UserSavedDdlCoreServiceImpl.java, v 0.1 September 25, 2022 15:50 moji Exp $
@date 2022/09/25
chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/impl/OperationServiceImpl.java