package com.jwipc.spe.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.spe.entity.SupAppraisePlan;
import com.jwipc.spe.mapper.SupAppraisePlanMapper;
import com.jwipc.spe.model.dto.ScoreReportDTO;
import com.jwipc.spe.model.query.ScoreReportQuery;
import com.jwipc.spe.service.ISupAppraisePlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 供应商考核计划 服务实现类
 * </p>
 *
 * @author zhangjie
 * @since 2024-03-11
 */
@Service
public class SupAppraisePlanServiceImpl extends ServiceImpl<SupAppraisePlanMapper, SupAppraisePlan> implements ISupAppraisePlanService {
    @Override
    public List<ScoreReportDTO> findPageByQuery(Page<ScoreReportDTO> dbPage, ScoreReportQuery query) {
        if (dbPage==null){
            return baseMapper.findPageByQuery(query);
        }
        return baseMapper.findPageByQuery(dbPage,query);
    }

    @Override
    public  List<SupAppraisePlan> selectPlanYearList(){
        return baseMapper.selectPlanYearList();
    }

    /**
     * 绩效考核连续三月不达标预警
     * @param queries
     * @return
     */
    @Override
    public  List<ScoreReportDTO> selectNeedWarnList(List<ScoreReportQuery> queries){
        return baseMapper.selectNeedWarnList(queries);
    }
}
