package com.gyee.generation.mapper.auto;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gyee.generation.model.auto.ProEconFaultLiminatedefects;
import com.gyee.generation.model.vo.FaultLiminatedefectsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 故障消缺及时率 Mapper 接口
 * </p>
 *
 * @author shilin
 * @since 2022-10-21
 */
public interface ProEconFaultLiminatedefectsMapper extends BaseMapper<ProEconFaultLiminatedefects> {

    @Select("select  sum(fault_count) as faultCount,sum(right_count)  as rightCount  from pro_econ_fault_liminatedefects t  where  t.date_time>=#{beginDate}   and  t.date_time<=#{endDate} and t.windpowerstation_id=#{wpId} ")
    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsRangeList(@Param(value = "beginDate") Date beginDate, @Param(value = "endDate") Date endDate, @Param(value = "wpId") String wpId);

    @Select("select  sum(fault_count) as faultCount,sum(right_count)  as rightCount  from pro_econ_fault_liminatedefects t  where  t.date_time=#{recordDate}   and t.windpowerstation_id=#{wpId} ")
    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsList(@Param(value = "recordDate") Date recordDate, @Param(value = "wpId") String wpId);


    @Select("select  sum(fault_count) as faultCount,sum(right_count)  as rightCount  from pro_econ_fault_liminatedefects t  where  t.date_time>=#{beginDate}   and  t.date_time<=#{endDate} and t.project_id=#{pjId} ")
    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsProjectRangeList(@Param(value = "beginDate") Date beginDate, @Param(value = "endDate") Date endDate, @Param(value = "pjId") String pjId);

    @Select("select  sum(fault_count) as faultCount,sum(right_count)  as rightCount  from pro_econ_fault_liminatedefects t  where  t.date_time=#{recordDate}   and t.project_id=#{pjId} ")
    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsProjectList(@Param(value = "recordDate") Date recordDate, @Param(value = "pjId") String pjId);

    @Select("select  sum(fault_count) as faultCount,sum(right_count)  as rightCount  from pro_econ_fault_liminatedefects t  where  t.date_time>=#{beginDate}   and  t.date_time<=#{endDate} and t.line_id=#{lnId} ")
    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsLineRangeList(@Param(value = "beginDate") Date beginDate, @Param(value = "endDate") Date endDate, @Param(value = "lnId") String lnId);

    @Select("select  sum(fault_count) as faultCount,sum(right_count)  as rightCount  from pro_econ_fault_liminatedefects t  where  t.date_time=#{recordDate}   and t.line_id=#{lnId} ")
    public List<FaultLiminatedefectsVo> queryFaultLiminatedefectsLineList(@Param(value = "recordDate") Date recordDate, @Param(value = "lnId") String lnId);

}
