package com.jwipc.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.sys.entity.BusinessAttachment;
import com.jwipc.sys.model.po.BusinessAttachmentPO;
import com.jwipc.sys.model.query.BusinessAttachmentQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  业务附件关系表 Mapper 接口
 * </p>
 *
 * @author Chen Tianshi
 * @since 2025/9/11 12:10
 */
public interface BusinessAttachmentMapper extends BaseMapper<BusinessAttachment> {
    List<BusinessAttachmentPO> findPageByQuery(@Param("query") BusinessAttachmentQuery query);
    List<BusinessAttachmentPO> findPageByQueryByCodes(@Param("query") BusinessAttachmentQuery query);

    List<BusinessAttachmentPO> findPageByQuery(Page<BusinessAttachment> dbPage, @Param("query") BusinessAttachmentQuery query);
    List<BusinessAttachmentPO> findPageByQueryByCodes(Page<BusinessAttachment> dbPage, @Param("query") BusinessAttachmentQuery query);

    List<String> findInvoiceByFileId(Long id);

    List<BusinessAttachmentPO> getListByBusinessId(@Param("businessId") Long businessId);

    BusinessAttachment getAccountByFileIdAndNotEqId(@Param("fileId") Long fileId, @Param("id") Long id);

    BusinessAttachment getPurchaseByFileIdAndNotEqId(@Param("fileId") Long fileId, @Param("id") Long id);
    BusinessAttachment getCustomsByFileIdAndNotEqId(@Param("fileId") Long fileId, @Param("id") Long id);
    BusinessAttachment getPaymentNoticeByFileIdAndNotEqId(@Param("fileId") Long fileId, @Param("id") Long id);

    BusinessAttachmentPO getDeliveryByPurchaseCode(@Param("businessCode") String businessCode);
}
