package org.jeecg.modules.projectManagement.mapper;

import java.util.Date;
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.basedata.entity.FdPersonnel;
import org.jeecg.modules.projectManagement.entity.FdProjectQuotation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.projectManagement.entity.FdProjectQuotationTemplateItem;

/**
 * @Description: 项目报价表
 * @author： jeecg-boot
 * @date：   2019-05-20
 * @version： V1.0
 */
public interface FdProjectQuotationMapper extends BaseMapper<FdProjectQuotation> {

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

    int updateStatusBatch(@Param("list") List<String> list);

    int updateReviewBatch(@Param("list") List<String> list);

    int updateAuditBatch(@Param("list") List<String> list);

    FdProjectQuotation getQuotationById(String id);

    List<FdPersonnel> getProjectManagerList();

    List<FdProjectQuotation> totalProportion(@Param("quotationDate") Date quotationDate,@Param("endDate") Date endDate,@Param("fdProjectQuotation")FdProjectQuotation fdProjectQuotation);

    List<FdProjectQuotation> signed(@Param("quotationDate") Date quotationDate,@Param("endDate") Date endDate,@Param("fdProjectQuotation")FdProjectQuotation fdProjectQuotation);

    List<FdProjectQuotation> monthlyGrouping(@Param("smallMonth") String smallMonth,@Param("largeMonth") String largeMonth,@Param("fdProjectQuotation")FdProjectQuotation fdProjectQuotation);

    /***
     * @Title:
            * @Description:TODO 批量修改模板对象父级
            * @param [templateItemList]
            * @return void
            * @exception
            * @author 陈创
            * @date 2020/3/4 13:57
            * @updatehistory:
     *   2020/3/4 13:57 新增
            */
    void parentIdBatch(@Param("templateItemList")List<FdProjectQuotationTemplateItem> templateItemList);

    /***
     * @Title:
            * @Description:TODO 修改报价状态
            * @param [list, status]
            * @return int
            * @exception
            * @author 陈创
            * @date 2020/3/4 13:53
            * @updatehistory:
     *   2020/3/4 13:53 新增
            */
    int updataStatusShared(@Param("list") List<String> list,@Param("status")String status);

    /***
     * @Title:修改审核人的状态
            * @Description:TODO
            * @param [list]
            * @return int
            * @exception
            * @author 陈创
            * @date 2019/11/28 17:13
            * @updatehistory:
     *   2019/11/28 17:13 新增
            */
    int updatePersonnelStatus(@Param("list") List<String> list,@Param("quotation")FdProjectQuotation fdProjectQuotation);

    int updateExamineStatusByQuotationId(@Param("projectQuotation")FdProjectQuotation fdProjectQuotation);

    /***
     * @Title:
            * @Description:TODO 根据多个项目档案id查询关联报价id
            * @param [list]
            * @return java.util.List<java.lang.String>
            * @exception
            * @author 陈创
            * @date 2020/4/8 17:20
            * @updatehistory:
     *   2020/4/8 17:20 新增
            */
    List<String> getQuotationIdsByfileIds(@Param("list") List<String> list);

    /***
     * @Title:
            * @Description:TODO 报表报价查询
            * @param [page, queryWrapper]
            * @return com.baomidou.mybatisplus.core.metadata.IPage<org.jeecg.modules.projectManagement.entity.FdProjectQuotation>
            * @exception
            * @author 陈创
            * @date 2020/4/23 14:40
            * @updatehistory:
     *   2020/4/23 14:40 新增
            */
    IPage<FdProjectQuotation> getReportPage(Page<FdProjectQuotation> page, @Param("ew")QueryWrapper<FdProjectQuotation> queryWrapper);


    /**
    * @Author chenchuang
    * @Description //TODO 修改最终申办方
    * @Date 2020/8/14 17:39
    * @Param [fdProjectQuotation]
    * @return void
    */
    void updateSponsorName(@Param("fdProjectQuotation")FdProjectQuotation fdProjectQuotation);
}
