a.in_order_id, a.organization_id, a.organization_name, a.top_organization_id, a.notice_number, a.in_order_number, a.status,
a.audit_status, a.audit_remark, a.audit_by, a.audit_by_name, a.audit_time, a.warehouse_id, a.warehouse_code, a.warehouse_name, a.shipper_id, a.shipper_code,
a.shipper_name, a.order_type_code, a.order_type_name, a.supplier_id, a.supplier_code, a.supplier_name, a.expect_time, a.supply_chain_number,
a.priority_level_code, a.priority_level_name, a.direct_warehouse, a.annex_url, a.material_quantity, a.quantity,a.business_order_no,a.amount,
a.business_price_way,a.business_charge_type,a.total_warehouse_rent,a.manpower_fee,a.fire_insure_fee,a.discount,a.is_free_manpower_fee,
-- 计划入库数量:入库明细表 in_material_detail 的 quantity 汇总
a.weight_limit, a.volume_limit, a.cancel_order, a.cancel_remark, a.cancel_by,a.PICTURE_URL,
a.cancel_by_name, a.cancel_time, a.close_order, a.close_remark, a.close_by, a.close_by_name, a.close_time, a.remark, a.create_time, a.create_by,
a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.over_stock_id, a.over_stock_status, a.over_stock_type,
a."TO", a.CONTACT_PERSON, a.VEHICLE_INFO, a.CONSIGNMENT_NO, a.TEL, a.DRIVER_SIGNATURE, a.FAX, a.DECLARATION_AREA, a.MANUFACTURER,
a.CUSTOMS_BROKER_INFO, a.DELIVERY_ADDRESS, a.ENTRY_EXIT_CUSTOMS, a.ORIGIN_DESTINATION_COUNTRY, a.CARRIER, a.CONTAINER_NO,
a.TRANSPORT_METHOD, a.SUPERVISION_METHOD, a.CUSTOMS_INSPECTION, a.NEED_CUSTOMS_DECLARATION, a.NEED_TRANSPORT,
a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.reservation_audit_time,a.reservation_audit_name
,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.RESERVATION_ORDER_SOURCE,a.tms_order_number
,a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.STORAGE_TIME,a.in_quantity,
a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME
,b.notice_number, b.warehouse_id, b.warehouse_code, b.warehouse_name, b.shipper_id, b.shipper_code, b.shipper_name,
b.order_type_code, b.order_type_name, b.supplier_id, b.supplier_code, b.supplier_name, b.expect_time, b.supply_chain_number, b.priority_level_code,
b.priority_level_name, b.direct_warehouse, b.annex_url, b.material_quantity as in_order_material_quantity, b.quantity as in_order_quantity
and b.notice_number = #{noticeNumber}
and b.in_order_number like concat('%', #{inOrderNumber}, '%')
and b.warehouse_id = #{warehouseId}
and b.warehouse_code = #{warehouseCode}
and b.warehouse_name like concat('%', #{warehouseName}, '%')
and b.shipper_id = #{shipperId}
and b.shipper_name like concat('%', #{shipperName}, '%')
and b.order_type_code = #{orderTypeCode}
and b.order_type_name like concat('%', #{orderTypeName}, '%')
and b.supplier_id = #{supplierId}
and b.supplier_name like concat('%', #{supplierName}, '%')
and b.expect_time = #{expectTime}
and b.supply_chain_number = #{supplyChainNumber}
and b.priority_level_code = #{priorityLevelCode}
and b.priority_level_name like concat('%', #{priorityLevelName}, '%')
and b.direct_warehouse = #{directWarehouse}
and b.annex_url = #{annexUrl}
and b.quantity = #{quantity}
and a.organization_id = #{organizationId}
and a.tms_order_number like concat('%', #{tmsOrderNumber}, '%')
and a.organization_name like concat('%', #{organizationName}, '%')
and a.top_organization_id = #{topOrganizationId}
and a.notice_number = #{noticeNumber}
and a.in_order_number = #{inOrderNumber}
and a.status = #{status}
and a.status < #{ltStatus}
and a.status > #{gtStatus}
and a.audit_status = #{auditStatus}
and a.audit_status < #{ltAuditStatus}
and a.audit_status > #{gtAuditStatus}
and a.audit_remark = #{auditRemark}
and a.audit_by = #{auditBy}
and a.audit_by_name like concat('%', #{auditByName}, '%')
and a.audit_time = #{auditTime}
and a.issue_status = #{issueStatus}
and a.warehouse_id = #{warehouseId}
and a.warehouse_code = #{warehouseCode}
and a.warehouse_name like concat('%', #{warehouseName}, '%')
and a.shipper_id = #{shipperId}
and a.shipper_name like concat('%', #{shipperName}, '%')
and a.order_type_code = #{orderTypeCode}
and (a.BUSINESS_TYPE like concat('%', #{orderTypeName}, '%') or a.ORDER_TYPE_CODE like concat('%', #{orderTypeName}, '%'))
and a.supplier_id = #{supplierId}
and a.supplier_name like concat('%', #{supplierName}, '%')
and a.expect_time = #{expectTime}
and a.supply_chain_number = #{supplyChainNumber}
and a.priority_level_code = #{priorityLevelCode}
and a.priority_level_name like concat('%', #{priorityLevelName}, '%')
and a.direct_warehouse = #{directWarehouse}
and a.annex_url = #{annexUrl}
and a.quantity = #{quantity}
and a.cancel_order = #{cancelOrder}
and a.cancel_remark = #{cancelRemark}
and a.cancel_by = #{cancelBy}
and a.cancel_by_name like concat('%', #{cancelByName}, '%')
and a.cancel_time = #{cancelTime}
and a.close_order = #{closeOrder}
and a.close_remark = #{closeRemark}
and a.close_by = #{closeBy}
and a.close_by_name like concat('%', #{closeByName}, '%')
and a.close_time = #{closeTime}
and a.create_by_name like concat('%', #{createByName}, '%')
and a.update_by_name like concat('%', #{updateByName}, '%')
and a.in_order_id in
#{item}
and a."TO" like concat('%', #{to}, '%')
and a.CONTACT_PERSON like concat('%', #{contactPerson}, '%')
and a.VEHICLE_INFO like concat('%', #{vehicleInfo}, '%')
and a.CONSIGNMENT_NO like concat('%', #{consignmentNo}, '%')
and a.TEL like concat('%', #{tel}, '%')
and a.DRIVER_SIGNATURE like concat('%', #{driverSignature}, '%')
and a.FAX like concat('%', #{fax}, '%')
and a.DECLARATION_AREA like concat('%', #{declarationArea}, '%')
and a.MANUFACTURER like concat('%', #{manufacturer}, '%')
and a.CUSTOMS_BROKER_INFO like concat('%', #{customsBrokerInfo}, '%')
and a.DELIVERY_ADDRESS like concat('%', #{deliveryAddress}, '%')
and a.ENTRY_EXIT_CUSTOMS like concat('%', #{entryExitCustoms}, '%')
and a.ORIGIN_DESTINATION_COUNTRY like concat('%', #{originDestinationCountry}, '%')
and a.CARRIER like concat('%', #{carrier}, '%')
and a.CONTAINER_NO = #{containerNo}
and a.TRANSPORT_METHOD = #{transportMethod}
and a.SUPERVISION_METHOD = #{supervisionMethod}
and a.CUSTOMS_INSPECTION = #{customsInspection}
and a.NEED_CUSTOMS_DECLARATION = #{needCustomsDeclaration}
and a.NEED_TRANSPORT = #{needTransport}
and a.WAREHOUSE_DATE = #{warehouseDate}
and a.COMPLETION_TIME = #{completionTime}
and a.ORDER_DATE = #{orderDate}
and a.create_time >= #{createTimeStart}
and a.create_time DATEADD(DAY, 1, #{createTimeEnd})
and a.PUSH_TIME =]]> #{pushTimeFrom}
and a.PUSH_TIME #{pushTimeTo}
and date_format(a.create_time,'%Y-%m-%d') >= #{createTimeFrom}
and date_format(a.create_time,'%Y-%m-%d') <= #{createTimeTo}
and a.PUSH_STATUS = #{pushStatus}
and a.BUSINESS_TYPE = #{businessType}
and a.RESERVATION_ORDER_SOURCE = #{reservationOrderSource}
and a.BUSINESS_NUMBER = #{businessNumber}
and a.create_by_name like concat('%', #{createByName}, '%')
and a.storage_time >= #{storageTimeStart}
and a.storage_time DATEADD(DAY, 1, #{storageTimeEnd})
and a.expect_time >= #{expectTimeStart}
and a.expect_time DATEADD(DAY, 1, #{expectTimeEnd})
and a.issue_time is not null
and a.issue_time is null
and exists (
select 1 from in_material_detail imd
left join material_base_info mb on imd.material_base_info_id = mb.material_base_info_id and mb.del_flag = 1
where imd.in_order_number = a.in_order_number
and imd.del_flag = 1
and (imd.level is null or imd.level = 1)
and (
imd.material_name like concat('%', #{materialName}, '%')
or mb.material_name like concat('%', #{materialName}, '%')
)
and (
imd.material_code like concat('%', #{materialCode}, '%')
or mb.material_code like concat('%', #{materialCode}, '%')
)
)
and a.del_flag = #{delFlag} and a.del_flag = 1
update "NGWL_TEST_WLHY".tms_order set ORDER_STATUS = 9 where ID = #{orderId}
update "NGWL_TEST_WLHY".TMS_TRANSPORT_NOTE set WAYBILL_STATUS =12 where TRANSPORTATION_NUMBER = #{transportationNumber}
update "NGWL_TEST_WMS".stock_out_order set return_quantity = #{quantity} where out_order_number = #{orderNumber}