diff --git a/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java b/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java index 3c84015a..1c1180b6 100644 --- a/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java +++ b/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java @@ -1008,6 +1008,58 @@ from ( ) as "入库单数量", + + (select array_agg(distinct re.id) + from t_warehouse_receipt re + inner join t_warehouse_receipt_detail d + on re.id = d.receipt_id + inner join t_warehouse_goods gs on d.goods_id = gs.id + where re.organization_id = s.organization_id + and re.receipt_type = '0' + and d.supplier_id = s.id + <#if startTime??> + and re.receipt_date >= :startTime + + <#if endTime??> + and re.receipt_date <= :endTime + + <#if reason??> + and re.reason like '%' || :reason || '%' + + <#if goodsIds?has_content> + and gs.id in :goodsIds + + + <#if barCode??> + and gs.bar_code like '%' || :barCode || '%' + + <#if code??> + and gs.code like '%' || :code || '%' + + + + <#if goodsName??> + + and gs.name like '%' || :goodsName || '%' + + + <#if categoryIds?has_content> + and gs.category_id in :categoryIds + + + <#if brandIds?has_content> + and gs.brand_id in :brandIds + + + <#if unitIds?has_content> + and gs.unit_id in :unitIds + + + <#if warehouseIds?has_content> + and d.warehouse_id in :warehouseIds + + + ) as "入库单ID", (select COALESCE(count(d.id),0) from t_warehouse_receipt re