package com.jeeplus.consultancy.approvalInfo.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeeplus.consultancy.approvalInfo.domain.*;
import com.jeeplus.consultancy.approvalInfo.service.dto.ConsultancyReimbursementAmountInfoDTO;
import com.jeeplus.consultancy.approvalInfo.service.dto.ConsultancyReportNoDto;
import com.jeeplus.consultancy.approvalInfo.service.dto.ConsultancyRetureListDto;
import com.jeeplus.consultancy.approvalInfo.service.dto.ConsultancyTreeUserDto;
import com.jeeplus.sys.domain.WorkAttachmentInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: 王强
 * @create: 2022-11-24 16:09
 **/
//@InterceptorIgnore(tenantLine = "true")
public interface ConsultancyReimbursementInfoMapper extends BaseMapper<ConsultancyReimbursementInfo> {

    IPage<ConsultancyProgramProjectListInfo> findProjectList(Page<ConsultancyProgramProjectListInfo> page, @Param(Constants.WRAPPER) QueryWrapper<ConsultancyProgramProjectListInfo> wrapper);

    String selectInvoiceFlag(@Param("id") String id);
    //@InterceptorIgnore(tenantLine = "true")
    IPage<ConsultancyRetureListDto> findList (Page<ConsultancyRetureListDto> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);

    @InterceptorIgnore(tenantLine = "true")
    List<WorkAttachmentInfo> findFiles(@Param("id") String id);

    void updateStatusById(@Param("id") String id, @Param("type") String type);

    List<ConsultancyTreeUserDto> findOfficeList();

    List<ConsultancyTreeUserDto> findUserList(@Param("name") String name);

    List<ConsultancyRetureListDto> findExportList (@Param(Constants.WRAPPER) QueryWrapper queryWrapper);

    IPage<ConsultancyRetureListDto> relationReimbursementList (Page<ConsultancyRetureListDto> page, @Param("id") String id);

    IPage<ConsultancyReportNoDto> getReportNoList(Page<ConsultancyReportNoDto> page, @Param(Constants.WRAPPER) QueryWrapper<ConsultancyReportNoDto> queryWrapper);
    @InterceptorIgnore(tenantLine = "true")
    List<ConsultancyReimbursementDetailInfoContract> getContractDetailList(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    List<ConsultancyReimbursementDetailInfoReport> getReportDetailList(@Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    List<ConsultancyReimbursementDetailInfoOther> getOtherDetailList(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    List<ConsultancyReimbursementDetailInfoProcured> getProcuredDetailList(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    List<ConsultancyReimbursementDetailInfo> getDetailList(@Param("id") String id);

    /**
     * 根据发票号查询是否已经或正在报销
     * @param invoiceNumber
     * @return
     */
    Integer getEffectiveDataByInvoiceNumber(@Param("invoiceNumber") String invoiceNumber, @Param("id") String id);
    /**
     * 提交时根据发票号查询是否已经或正在报销
     * @param invoiceNumber
     * @return
     */
    List<String> getEffectiveDataByNumbers(@Param("invoiceNumber") List<String> invoiceNumber, @Param("id") String id);

    /**
     * 提交时根据发票号查询是否已经或正在报销
     * @param invoiceNumber
     * @return
     */
    List<String> getEffectiveDataByNumbers2(@Param("invoiceNumber") List<String> invoiceNumber, @Param("id")String id);

    Integer deleteByIdAndNumber(@Param("invoiceNumber") String invoiceNumber, @Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    List<ConsultancyReimbursementAmountInfoDTO> getInvoiceReimbursementAmountList(@Param("idList") List<String> idList);

    void updatePaymentById(@Param("id") String id,@Param("paymentStatus") String paymentStatus);

    @InterceptorIgnore(tenantLine = "true")
    List<WorkAttachmentInfo> findReimFiles(@Param("infoId") String infoId,@Param("attachmentFlag") String attachmentFlag);

}
