SELECT
a.id,
a.create_by,
a.create_by_name,
a.create_time,
a.update_by,
a.update_by_name,
a.update_time,
a.del_flag,
a.top_organization_id,
a.organization_id,
a.organization_name,
a.audit_by,
a.audit_time,
a.audit_state,
a.audit_result,
a.order_no,
a.order_state,
a.supplier_id,
a.supplier,
a.shipper_id,
a.shipper,
a.org_id,
a.org,
a.order_time,
a.order_type_id,
a.order_type,
a.job_task_type_id,
a.job_task_type,
a.receiving_warehouse_id,
a.receiving_warehouse,
a.delivery_date,
a.customer_orders,
a.contract_no,
a.project_id,
a.project,
a.rate_concession,
a.discount_amount,
a.total_amount,
a.file_name,
a.file_url,
a.source,
a.tackl_state,
a.tackl_time,
a.remark,
a.total_price_tax,
a.material_info,
a.material_num,
a.in_storage_num,
b.settlement_obj,
b.settlement_way,
b.pay_status
FROM
oms_purchase_order a
LEFT JOIN oms_settlement b on a.id = b.order_id
WHERE
a.del_flag = 1
and a.top_organization_id = #{topOrganizationId}
and a.organization_id = #{organizationId}
and a.organization_name like concat('%', #{organizationName}, '%')
and a.audit_by = #{auditBy}
and a.audit_time = #{auditTime}
and a.audit_state = #{auditState}
and a.audit_result = #{auditResult}
and a.order_no = #{orderNo}
and a.order_state = #{orderState}
and a.supplier_id = #{supplierId}
and a.supplier = #{supplier}
and a.shipper_id = #{shipperId}
and a.shipper = #{shipper}
and a.org_id = #{orgId}
and a.org = #{org}
and a.order_time = #{orderTime}
and a.order_type_id = #{orderTypeId}
and a.order_type = #{orderType}
and a.job_task_type_id = #{jobTaskTypeId}
and a.job_task_type = #{jobTaskType}
and a.receiving_warehouse_id = #{receivingWarehouseId}
and a.receiving_warehouse = #{receivingWarehouse}
and a.delivery_date = #{deliveryDate}
and a.customer_orders = #{customerOrders}
and a.contract_no = #{contractNo}
and a.project_id = #{projectId}
and a.project = #{project}
and a.tackl_state = #{tacklState}
and a.tackl_time = #{tacklTime}
and a.source = #{source}