package cn.com.countrygarden.bi.main.dao.performance;


import cn.com.countrygarden.bi.main.model.performance.PerformanceStatistics;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.TreeSet;

/**
 * 分数统计
 *
 * @author 59434
 * @version 2018-4-8 15:11:44
 *
 */

public interface PerformanceStatisticsMapper extends Mapper<PerformanceStatistics> {

	public int insertStatisticsList(@Param("statisticsList") List<PerformanceStatistics> statisticsList);
	public List<PerformanceStatistics> selectStatisticsList(@Param("sta") PerformanceStatistics sta);



	/**
	 *
	 *  插入各指标季度平均分
	 *
	 * @Author Geoffrey
	 * @Date 2018/7/11 18:00
	 * @param year 年份
	 * @param quarter 季度
	 * @return 无
	 */
	void insertQuarterlyAverageScore(@Param("year") int year, @Param("quarter") int quarter);

	void deleteQuarterlyAverageScore(@Param("year") int year, @Param("quarter") int quarter);

	//------------三期重构--------------
	int deleteAllByRecordIds(@Param("year") int year, @Param("quarter") int quarter);

	int insertQuarterlyAverageScore2(@Param("year") int year, @Param("quarter") int quarter);

	PerformanceStatistics selectBySelective(@Param("elementId")long elementId,@Param("year")int year,@Param("quarter")int quarter);

	//查询指标所有季度的平均分
	TreeSet<PerformanceStatistics> selectAllQuarterAve(@Param("year")int year, @Param("elementId")long elementId);
}
