package com.jeeplus.centrecareful.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.centrecareful.approvalInfo.domain.*;
import com.jeeplus.centrecareful.approvalInfo.service.dto.ZsReimbursementAmountInfoDTO;
import com.jeeplus.centrecareful.approvalInfo.service.dto.ZsReportNoDto;
import com.jeeplus.centrecareful.approvalInfo.service.dto.ZsRetureListDto;
import com.jeeplus.centrecareful.approvalInfo.service.dto.ZsTreeUserDto;
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 ZsReimbursementInfoMapper extends BaseMapper<ZsReimbursementInfo> {

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

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

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

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

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

    IPage<ZsReportNoDto> getReportNoList(Page<ZsReportNoDto> page, @Param(Constants.WRAPPER) QueryWrapper<ZsReportNoDto> queryWrapper);
    @InterceptorIgnore(tenantLine = "true")
    List<ZsReimbursementDetailInfoContract> getContractDetailList(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    List<ZsReimbursementDetailInfoReport> getReportDetailList(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    List<ZsReimbursementDetailInfoReport> getCwReportDetailList(@Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    List<ZsReimbursementDetailInfoOther> getOtherDetailList(@Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    List<ZsReimbursementDetailInfoProject> getZsProjectDetailList(@Param("id") String id);

    @InterceptorIgnore(tenantLine = "true")
    List<ZsReimbursementDetailInfoProcured> getProcuredDetailList(@Param("id") String id);
    @InterceptorIgnore(tenantLine = "true")
    List<ZsReimbursementDetailInfo> 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<ZsReimbursementAmountInfoDTO> getInvoiceReimbursementAmountList(@Param("idList") List<String> idList);

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

    @InterceptorIgnore(tenantLine = "true")
    String findUserById(@Param("projectUser") String projectUser);
    @InterceptorIgnore(tenantLine = "true")
    String findOfficeById(@Param("projectOffice")String projectOffice);

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

}
