package com.jeeplus.ccpm.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.ccpm.approvalInfo.domain.*;
import com.jeeplus.ccpm.approvalInfo.service.dto.CcpmReimbursementAmountInfoDTO;
import com.jeeplus.ccpm.approvalInfo.service.dto.CcpmReportNoDto;
import com.jeeplus.ccpm.approvalInfo.service.dto.CcpmRetureListDto;
import com.jeeplus.ccpm.approvalInfo.service.dto.CcpmTreeUserDto;
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 CcpmReimbursementInfoMapper extends BaseMapper<CcpmReimbursementInfo> {

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

    String selectInvoiceFlag(@Param("id") String id);
    //@InterceptorIgnore(tenantLine = "true")
    IPage<CcpmRetureListDto> findList (Page<CcpmRetureListDto> 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<CcpmTreeUserDto> findOfficeList();

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

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

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

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

    @InterceptorIgnore(tenantLine = "true")
    List<CcpmReimbursementDetailInfoOther> getOtherDetailList(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    List<CcpmReimbursementDetailInfoProcured> getProcuredDetailList(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    List<CcpmReimbursementDetailInfo> 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<CcpmReimbursementAmountInfoDTO> 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);
}
