package com.fs.qw.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.common.exception.ServiceException;
import com.fs.qw.domain.QwExternalContactTransferCompanyAuditUser;
import com.fs.qw.dto.CompanyTransferAuditDTO;
import com.fs.qw.mapper.QwExternalContactTransferCompanyAuditUserMapper;
import com.fs.qw.service.IQwExternalContactTransferCompanyAuditUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;


@Service
public class QwExternalContactTransferCompanyAuditUserServiceImpl extends ServiceImpl<QwExternalContactTransferCompanyAuditUserMapper, QwExternalContactTransferCompanyAuditUser>
        implements IQwExternalContactTransferCompanyAuditUserService {

    /**
     * 根据ID集合查询已提交的记录
     */
    @Override
    public List<QwExternalContactTransferCompanyAuditUser> getExistAuditByExtIds(List<Long> ids) {
        if (ids.isEmpty()) {
            return new ArrayList<>();
        }
        return baseMapper.getExistAuditByExtIds(ids);
    }

    /**
     * 根据审核ID查询记录
     */
    @Override
    public List<QwExternalContactTransferCompanyAuditUser> getListByAuditId(Long auditId) {
        Wrapper<QwExternalContactTransferCompanyAuditUser> queryWrapper = Wrappers.<QwExternalContactTransferCompanyAuditUser>lambdaQuery()
                .eq(QwExternalContactTransferCompanyAuditUser::getAuditId, auditId);
        return baseMapper.selectList(queryWrapper);
    }
}
