package com.gyee.generation.service.auto.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gyee.generation.mapper.auto.ProEconFaultLiminatedefectsMapper;
import com.gyee.generation.model.auto.ProEconFaultLiminatedefects;
import com.gyee.generation.model.vo.FaultLiminatedefectsVo;
import com.gyee.generation.service.auto.IProEconFaultLiminatedefectsService;
import com.gyee.generation.util.StringUtils;
import org.springframework.stereotype.Service;

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

/**
 * <p>
 * 故障消缺及时率 服务实现类
 * </p>
 *
 * @author shilin
 * @since 2022-10-21
 */
@Service
public class ProEconFaultLiminatedefectsServiceImpl extends ServiceImpl<ProEconFaultLiminatedefectsMapper, ProEconFaultLiminatedefects> implements IProEconFaultLiminatedefectsService {

    @Resource
    private ProEconFaultLiminatedefectsMapper proEconFaultLiminatedefectsMapper;

    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsRangeList(Date beginDate, Date endDate, String wpId) {
        List<FaultLiminatedefectsVo> ls = new ArrayList<>();
        if (StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate) && StringUtils.notEmp(wpId)) {
            ls = proEconFaultLiminatedefectsMapper.queryFaultLiminatedefectsRangeList(beginDate, endDate, wpId);
        }
        return ls;
    }

    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsList(Date recordDate, String wpId) {
        List<FaultLiminatedefectsVo> ls = new ArrayList<>();
        if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wpId)) {
            ls = proEconFaultLiminatedefectsMapper.queryFaultLiminatedefectsList(recordDate, wpId);
        }
        return ls;
    }

    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsProjectRangeList(Date beginDate, Date endDate, String pjId) {
        List<FaultLiminatedefectsVo> ls = new ArrayList<>();
        if (StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate) && StringUtils.notEmp(pjId)) {
            ls = proEconFaultLiminatedefectsMapper.queryFaultLiminatedefectsProjectRangeList(beginDate, endDate, pjId);
        }
        return ls;
    }

    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsProjectList(Date recordDate, String pjId) {
        List<FaultLiminatedefectsVo> ls = new ArrayList<>();
        if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(pjId)) {
            ls = proEconFaultLiminatedefectsMapper.queryFaultLiminatedefectsProjectList(recordDate, pjId);
        }
        return ls;
    }

    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsLineRangeList(Date beginDate, Date endDate, String lnId) {
        List<FaultLiminatedefectsVo> ls = new ArrayList<>();
        if (StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate) && StringUtils.notEmp(lnId)) {
            ls = proEconFaultLiminatedefectsMapper.queryFaultLiminatedefectsLineRangeList(beginDate, endDate, lnId);
        }
        return ls;
    }

    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsLineList(Date recordDate, String lnId) {
        List<FaultLiminatedefectsVo> ls = new ArrayList<>();
        if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(lnId)) {
            ls = proEconFaultLiminatedefectsMapper.queryFaultLiminatedefectsLineList(recordDate, lnId);
        }
        return ls;
    }
}
