gaoluyang
2026-11-04 fbaeeeff5704f210bc6347454c0f16d255001822
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/finance/ErpFinancePaymentMapper.java
@@ -14,6 +14,7 @@
import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -84,4 +85,20 @@
        return convertMap(result, obj -> (Long) obj.get("invoice_id"), obj -> (BigDecimal) obj.get("total_payment_price"));
    }
    /**
     * 按供应商与付款时间范围查询付款单(供应商往来)
     */
    default List<ErpFinancePaymentDO> selectListBySupplierIdAndPaymentTimeBetween(Long supplierId,
                                                                                 LocalDateTime beginTime,
                                                                                 LocalDateTime endTime,
                                                                                 Collection<Integer> statuses) {
        return selectList(new LambdaQueryWrapperX<ErpFinancePaymentDO>()
                .eq(ErpFinancePaymentDO::getSupplierId, supplierId)
                .geIfPresent(ErpFinancePaymentDO::getPaymentTime, beginTime)
                .leIfPresent(ErpFinancePaymentDO::getPaymentTime, endTime)
                .inIfPresent(ErpFinancePaymentDO::getStatus, statuses)
                .orderByAsc(ErpFinancePaymentDO::getPaymentTime)
                .orderByAsc(ErpFinancePaymentDO::getId));
    }
}