package com.persagy.adm.server.algorithm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.persagy.adm.server.algorithm.entity.AdmModelFile;
import com.persagy.adm.server.algorithm.service.AdmModelFileService;
import com.persagy.adm.server.algorithm.dao.AdmModelFileMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 模型文件逻辑处理接口
 * @author : lijie
 * Update By 2022/1/17 10:54
 */
@Service
public class AdmModelFileServiceImpl extends ServiceImpl<AdmModelFileMapper, AdmModelFile> implements AdmModelFileService{
    /**
     * 根据状态查询模型文件列表
     * @param status : {@see AdmModelStatusEnum#value}
     * @return : java.util.List<com.persagy.adm.server.algorithm.entity.AdmModelFile>
     * @author : lijie
     * Update By 2022/1/17 10:52
     */
    @Override
    public List<AdmModelFile> listByStatus(Integer status) {
        LambdaQueryWrapper<AdmModelFile> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AdmModelFile::getStatus,status);
        queryWrapper.eq(AdmModelFile::getRemoved,"0");
        queryWrapper.eq(AdmModelFile::getValid,Boolean.TRUE);
        return this.list(queryWrapper);
    }
}




