Replace frappe.db.sql to frappe.db.get_all

[Dos and Don’ts #1] frappe.db.get_value - Developers - ERPNext Forum
From the link above stated the frappe.db.sql is not a good way to run the sql query, so:

Expectation result:

i want to replace the frappe.db.sql (left side) to frappe.db.get_all (right side) and i cant find out the error for filters and order_by