Q:

Is there a way to make a custom orderBy in Drupal query

Im going to order my table by a custom status order 0,4,1,2,3 and have no clue how to do this with drupal query
when doing it with mysql i can 
select * from table order by field(status, 0,4,1,2,3)

is there any way to do this with drupal?
$query->orderBy('status', array(0,4,1,2,3));

or something?

A:

I've faced with it many years ago. And I found solution for Drupal 7 like:
$query->orderBy('FIELD(node.nid, 5,12,3,6)', 'ASC');

Probably it will work for you.
As I remeber I've found it here

