package com.zksy.system.basicData.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zksy.system.basicData.domain.CrmFile;
import com.zksy.system.basicData.mapper.CrmFileMapper;
import com.zksy.system.basicData.service.CrmFileService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 文件管理Service业务层处理
 *
 * @author sy
 * @date 2024-05-20
 */
@Service
public class CrmFileServiceImpl extends ServiceImpl<CrmFileMapper, CrmFile> implements CrmFileService {

    @Autowired
    private CrmFileService service;

    @Override
    public List<CrmFile> selectByFids(List<String> fids) {
        QueryWrapper<CrmFile> queryWrapper =new QueryWrapper<>();
        queryWrapper.in("fid",fids);
        BaseMapper<CrmFile> baseMapper = service.getBaseMapper();
        List<CrmFile> crmFileList = baseMapper.selectList(queryWrapper);
        return crmFileList;
    }

    @Override
    public List<CrmFile> selectByFid(Long fid) {
        QueryWrapper<CrmFile> queryWrapper =new QueryWrapper<>();
        queryWrapper.eq("fid",fid);
        BaseMapper<CrmFile> baseMapper = service.getBaseMapper();
        List<CrmFile> crmFileList = baseMapper.selectList(queryWrapper);
        return crmFileList;
    }
}
