package com.gyee.runeconomy.mapper.auto;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gyee.runeconomy.model.auto.ProEconBenchmarkingBetween;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author wang
 * @since 2023-02-03
 */
public interface ProEconBenchmarkingBetweenMapper extends BaseMapper<ProEconBenchmarkingBetween> {

    @Select("select duty_name dutyName,sum(theoretical_generatity) theoreticalGeneratity,sum(generatity) generatity,sum(fault_loss) faultLoss,sum(main_loss) mainLoss,sum(performance_loss) performanceLoss,sum(rationing_loss) rationingLoss,sum(involves_loss) involvesLoss from pro_econ_benchmarking_between where theday>=#{begin} and theday <=#{end} group by duty_name ")
    public List<ProEconBenchmarkingBetween> findByBeginAndEnd(@Param(value = "begin") Date begin, @Param(value = "end") Date end);

}
