package cn.wisenergy.mapper;

import cn.wisenergy.model.dto.ProjectStatisticsByMonth;
import cn.wisenergy.model.dto.WorkTimeAndCostCollect;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @description:
 * @author: nh
 * @create: 2021-02-07 11:09
 **/
public interface WorkProjectTimeCostMapper {

    /**
     * 根据添加查询项目统计信息
     */
    int statisticsTimeOrderByMonth(String date);

    /**
     * 统计项目总工时和成本，按月统计
     * @param map
     */
    List<WorkTimeAndCostCollect> selectList(Map<String, Object> map);

    /**
     * 部门编号不为空，查询部门下所有项目统计。部门主键为空时，查询项目主键参数为主键的项目信息
     * @param year
     * @param deptId
     * @param projectId
     * @return
     */
    List<ProjectStatisticsByMonth> selectListByMonth(@Param("year") Integer year,@Param("deptId") Integer deptId,@Param("projectId") Integer projectId);

    List<ProjectStatisticsByMonth> selectListStatistics(@Param("year") Integer year,@Param("deptId") Integer deptId,@Param("projectId") Integer projectId);


    /**
     * 删除月份大于参数的统计数据
     * @return
     */
    int deleteStatisticsByQuarter(String date);

}
