(SELECT COUNT(1) from jg_warehousing_outbound_product WHERE warehousing_outbound_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_outbound_poundlist WHERE warehousing_outbound_id = a.id) voucherNum,
(SELECT COUNT(1) from jg_warehousing_storage_product WHERE warehousing_storage_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_storage_poundlist WHERE warehousing_storage_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_outbound_type WHEN 1 THEN '销售出库' WHEN 3 THEN '退供出库' WHEN 12 THEN '销售发货单出库' WHEN 9 THEN '库存初始化' END warehousingStorageType,
case a.warehousing_storage_type WHEN 1 THEN '采购入库' WHEN 3 THEN '退货入库' WHEN 11 THEN '库存初始化' WHEN 15 THEN '采购收货单入库' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_outbound a
from jg_warehousing_storage a
LEFT JOIN flow_task b on a.id = b.f_process_id
LEFT JOIN jg_warehousing_notification c ON a.warehousing_id = c.id
LEFT JOIN jg_business_order d ON c.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id ${ew.customSqlSegment}
and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_outbound_type in (1,3,12,9)
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id
${ew.customSqlSegment} and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_storage_type in (1,3,11,15)
and d.first_subject_basic_id = #{warehousingStoragePagination.subjectId} and d.contract_id = #{warehousingStoragePagination.contractId}
<iftest="warehousingStoragePagination.excludeIdList!= null and warehousingStoragePagination.excludeIdList.size()>0">
(SELECT COUNT(1) from jg_warehousing_storage_product WHERE warehousing_storage_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_storage_poundlist WHERE warehousing_storage_id = a.id) voucherNum,
(SELECT COUNT(1) from jg_warehousing_outbound_product WHERE warehousing_outbound_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_outbound_poundlist WHERE warehousing_outbound_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_storage_type WHEN 1 THEN '采购入库' WHEN 3 THEN '退货入库' WHEN 11 THEN '库存初始化' WHEN 15 THEN '采购收货单入库' END warehousingStorageType,
case a.warehousing_outbound_type WHEN 1 THEN '销售出库' WHEN 3 THEN '退供出库' WHEN 12 THEN '销售发货单出库' WHEN 9 THEN '库存初始化' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_storage a
from jg_warehousing_outbound a
LEFT JOIN flow_task b on a.id = b.f_process_id
LEFT JOIN jg_warehousing_notification c ON a.warehousing_id = c.id
LEFT JOIN jg_business_order d ON c.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id
${ew.customSqlSegment} and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_storage_type in (1,3,11,15)
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id ${ew.customSqlSegment}
and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_outbound_type in (1,3,12,9)
and d.first_subject_basic_id = #{warehousingStoragePagination.subjectId} and d.contract_id = #{warehousingStoragePagination.contractId}
<iftest="warehousingStoragePagination.excludeIdList!= null and warehousingStoragePagination.excludeIdList.size()>0">