package com.jeeplus.assess.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.assess.reimbursement.reimbursementInfo.domain.*;
import com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.ReimbursementAmountInfoDTO;
import com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.RetureListDto;
import com.jeeplus.assess.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();

    /**
     * 查询非指定租户的所有部门信息
     * @param tenantId
     * @return
     */
    List<TreeUserDto> findOfficeListByNotTenantId(String tenantId);

    /**
     * 查询非指定租户的所有部门信息
     * @param tenantId
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findOfficeListByTenantId(String tenantId);

    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findOfficeList2();

    /**
     * 根据公司id查询公司下所有部门信息
     * @param companyId
     * @return
     */

    List<TreeUserDto> findOfficeListByCompanyId(@Param("companyId")String companyId);
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findOfficeListByCompanyId2(@Param("companyId")String companyId);

    List<TreeUserDto> findUserList(@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);
    /**
     * 提交时根据发票号查询是否已经或正在报销
     * @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<ReimbursementAmountInfoDTO> getInvoiceReimbursementAmountList(@Param("idList") List<String> idList);
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findZhglgsUserList( @Param("name")String name);
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findZsUserList( @Param("name")String name,@Param("zsOfficeName")String zsOfficeName);
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findCwglgsUserList( @Param("name")String name);
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findZhglgsUserList2( @Param("name")String name);
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> finduserAllList(@Param("name")String name);
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findCertUserList(@Param("name")String name);

    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findOfficeListByIdList(@Param("idList") List<String> idList);

    void updatePaymentById(@Param("id") String id,@Param("paymentStatus") String paymentStatus);
    @InterceptorIgnore(tenantLine = "true")
    List<TreeUserDto> findZhglgsUserList3(@Param("name")String name, @Param("officeId")String officeId);

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

}
