package org.jeecg.modules.projectManagement.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.projectManagement.entity.FdProjectFile;
import org.jeecg.modules.projectManagement.entity.FdWorkingHoursItems;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: 工时记录明细
 * @author： jeecg-boot
 * @date：   2019-06-25
 * @version： V1.0
 */
public interface FdWorkingHoursItemsMapper extends BaseMapper<FdWorkingHoursItems> {
    FdWorkingHoursItems queryByContractId(String contractId);

    FdWorkingHoursItems queryBySpecialType();

    IPage<FdWorkingHoursItems> findByPage(Page<FdWorkingHoursItems> page, @Param("ew")QueryWrapper<FdWorkingHoursItems> queryWrapper);

    List<FdWorkingHoursItems> getWorkingReport(@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("departs")List<String> departs);

    List<FdWorkingHoursItems> getWorkingReportPersonnel(@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("personnelCodes") List<String> personnelCodes);

    /***
     * @Title:根据人员与工时时间查询工时求和
            * @Description:TODO
            * @param startDate, endDate]
            * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdWorkingHoursItems>
            * @exception 
            * @author 陈创
            * @date 2019/10/29 11:38
            * @updatehistory:
     *   2019/10/29 11:38 新增
            */
    List<FdWorkingHoursItems> getWorkingItemsSumHours(@Param("startDate")String startDate,@Param("endDate")String endDate);
    
    /***
     * @Title:查询已审核合同
            * @Description:TODO
            * @param fdProjectFile
            * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdProjectFile>
            * @exception 
            * @author 陈创
            * @date 2019/9/4 14:37
            * @updatehistory:
     *   2019/9/4 14:37 新增
            */
    List<FdProjectFile> getContractList(@Param("fdProjectFile")FdProjectFile fdProjectFile);

    /**
     * 导出个人工时数据
     * @return
     */
    List<FdWorkingHoursItems>  getWorkingItemsExport(@Param("fdWorkingHoursItems")FdWorkingHoursItems fdWorkingHoursItems);

    /**
    * @Author chenchuang
    * @Description //TODO 根据时间查询导出数据
    * @Date 2020/6/3 13:31
    * @Param [fdWorkingHoursItems]
    * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdWorkingHoursItems>
    */
    List<FdWorkingHoursItems>  getDateExport(@Param("fdWorkingHoursItems")FdWorkingHoursItems fdWorkingHoursItems,@Param("list") List<String> list);

    /**
    * @Author chenchuang
    * @Description //TODO 根据时间查询条件 统计非项目按人员统计非项目工时
    * @Date 2020/6/12 9:34
    * @Param [fdWorkingHoursItems, list]
    * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdWorkingHoursItems>
    */
    List<FdWorkingHoursItems>  getDateExport2(@Param("fdWorkingHoursItems")FdWorkingHoursItems fdWorkingHoursItems,@Param("list") List<String> list);


    /**
    * @Author chenchuang
    * @Description //TODO 项目工时非分组根据条件查询明细
    * @Date 2020/6/12 13:07
    * @Param [fdWorkingHoursItems, list]
    * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdWorkingHoursItems>
    */
    List<FdWorkingHoursItems>  getProjectDayExport(@Param("fdWorkingHoursItems")FdWorkingHoursItems fdWorkingHoursItems,@Param("list") List<String> list);

    /**
    * @Author chenchuang
    * @Description //TODO 非项目工时不分组根据条件查询明细
    * @Date 2020/6/12 13:07
    * @Param [fdWorkingHoursItems, list]
    * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdWorkingHoursItems>
    */
    List<FdWorkingHoursItems>  getNotProjectDayExport(@Param("fdWorkingHoursItems")FdWorkingHoursItems fdWorkingHoursItems,@Param("list") List<String> list);

    /**
    * @Author chenchuang
    * @Description //TODO 根据合同id查询项目总工时
    * @Date 2020/6/30 10:25
    * @Param [contractId]
    * @return java.lang.Double
    */
    String getProjectTotalByProjectId(@Param("contractId") String contractId);

    /**
    * @Author chenchuang
    * @Description //TODO 工时查看分页查询
    * @Date 2020/7/23 13:59
    * @Param [page, queryWrapper]
    * @return com.baomidou.mybatisplus.core.metadata.IPage<org.jeecg.modules.projectManagement.entity.FdWorkingHoursItems>
    */
    IPage<FdWorkingHoursItems> getViewPage(Page<FdWorkingHoursItems> page, @Param("ew")QueryWrapper<FdWorkingHoursItems> queryWrapper);

}
