package org.jeecg.modules.projectManagement.mapper;


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.FdContract;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.basedata.entity.FdQuotationTemplate;
import org.jeecg.modules.projectManagement.entity.FdProjectQuotation;

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

/**
 * @Description: 合同档案基本信息表
 * @author： jeecg-boot
 * @date： 2019-05-22
 * @version： V1.0
 */
public interface FdContractMapper extends BaseMapper<FdContract> {

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

    List<FdQuotationTemplate> findQuotationTemplate(String quotationId);

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

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

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

    List<FdContract> contractReport(@Param("startDate")String startDate,@Param("endDate")String endDate);

    /***
     * @Title:修改合同状态 公用
            * @Description:TODO
            * @param [list, status]
            * @return int
            * @exception
            * @author 陈创
            * @date 2019/11/29 10:16
            * @updatehistory:
     *   2019/11/29 10:16 修改
            */
    int updateStatusShared(@Param("list") List<String> list,@Param("status")String status);

    /***
     * @Title:
            * @Description:TODO 根据合同对象信息筛选查询集合
            * @param [fdContract]
            * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdContract>
            * @exception
            * @author 陈创
            * @date 2020/3/10 15:42
            * @updatehistory:
     *   2020/3/10 15:42 新增
            */
    List<FdContract> listByRelationCode(@Param("fdContract")FdContract fdContract);

    FdContract joinQuotationByContract(@Param("fdContract")FdContract fdContract);

    /***
     * @Title:
            * @Description:TODO 报表统计查询 报价数
            * @param [quotationDate, endDate, fdContract]
            * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdContract>
            * @exception
            * @author 陈创
            * @date 2020/4/26 10:58
            * @updatehistory:
     *   2020/4/26 10:58 新增
            */
    List<FdContract> totalProportionContract(@Param("quotationDate") Date quotationDate, @Param("endDate") Date endDate, @Param("fdContract")FdContract fdContract);

    /***
     * @Title:
            * @Description:TODO 报表查询 数据表格查询
            * @param [page, queryWrapper]
            * @return com.baomidou.mybatisplus.core.metadata.IPage<org.jeecg.modules.projectManagement.entity.FdContract>
            * @exception
            * @author 陈创
            * @date 2020/4/26 10:59
            * @updatehistory:
     *   2020/4/26 10:59 新增
            */
    IPage<FdContract> getReportPageContract(Page<FdContract> page, @Param("ew")QueryWrapper<FdContract> queryWrapper);


    List<FdContract> getContractExport(@Param("fdContract") FdContract fdContract,@Param("list") List<String> list);

    /**
    * @Author chenchuang
    * @Description //TODO 关联项目档案分组查询合同号
    * @Date 2020/5/28 13:20
    * @Param []
    * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdContract>
    */
    List<FdContract> getContractGroupById();

    /**
    * @Author chenchuang
    * @Description //TODO 根据项目档案联表查询合同数据
    * @Date 2020/8/28 13:54
    * @Param []
    * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdContract>
    */
    List<FdContract> getContractAndFild();
}
