package com.jeeplus.finance.reimbursement.reimbursementInfo.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.finance.reimbursement.reimbursementInfo.domain.*;
import com.jeeplus.finance.reimbursement.reimbursementInfo.service.dto.ReimbursementAmountInfoDTO;
import com.jeeplus.finance.reimbursement.reimbursementInfo.service.dto.RetureListDto;
import com.jeeplus.finance.reimbursement.reimbursementInfo.service.dto.TreeUserDto;
import com.jeeplus.sys.domain.WorkAttachmentInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

//@InterceptorIgnore(tenantLine = "true")
public interface ReimbursementInfoMapper extends BaseMapper<ReimbursementInfo> {

    IPage<RetureListDto> findList (Page<RetureListDto> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);

    List<WorkAttachmentInfo> findFiles(@Param("id") String id);

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

    List<TreeUserDto> findOfficeList();

    /**
     * 根据公司id查询公司下所有部门信息
     * @param companyId
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findOfficeListByCompanyId(@Param("companyId")String companyId);
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findOfficeListByCompanyId2();

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

    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findUserListNew(@Param("name") String name);

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

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

    List<TreeUserDto> findOfficeListByUserName(String name);

    List<ReimbursementDetailInfoContract> getContractDetailList(@Param("id") String id);

    List<ReimbursementDetailInfoOther> getOtherDetailList(@Param("id") String id);

    List<ReimbursementDetailInfoProcured> getProcuredDetailList(@Param("id") String id);

    /**
     * 查询详情列表
     * 过滤限制保留
     * @param id
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    List<ReimbursementDetailInfo> getDetailList(@Param("id") String id);

    /**
     * 根据id查询报销编号
     * @param id
     * @return
     */
    String getNumberById(String id);

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

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