package org.jeecg.modules.database.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.database.entity.ExperimentFile;
import org.jeecg.modules.database.mapper.ExperimentFileMapper;
import org.jeecg.modules.database.service.IExperimentFileService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 试验文件
 * @Author: jeecg-boot
 * @Date: 2024-12-09
 * @Version: V1.0
 */
@Service
public class ExperimentFileServiceImpl extends ServiceImpl<ExperimentFileMapper, ExperimentFile> implements IExperimentFileService {

    @Override
    public List<ExperimentFile> getByExperimentId(String experimentId) {
        return list(new LambdaQueryWrapper<ExperimentFile>().eq(ExperimentFile::getExperimentId, experimentId));
    }

    @Override
    public List<ExperimentFile> getByType(String experimentId, String type) {
        return list(new LambdaQueryWrapper<ExperimentFile>().eq(ExperimentFile::getExperimentId, experimentId).eq(
                ExperimentFile::getFileType, type));
    }
}
