Короче получилось чтото вроде этого
SELECT vacancy.*, helper_country.name as country_name , helper_country_state.name as country_state_name, client.company_name as company_name, client.logo_image_path as logo, client.id as client_id
, user_watching_list.id as in_watching_list,
IF(vacancy.subject_id = 113 , 0 , 1) AS sort1,
IF(vacancy.offer_type_id = 1 , 0 , 1) AS sort2,
IF(vacancy.id IN (SELECT category_id FROM entity_category where vacancy_id = vacancy.id) , 0 , 1)AS sort3
FROM vacancy
LEFT JOIN helper_country ON vacancy.country_id = helper_country.id
LEFT JOIN helper_country_state ON vacancy.country_state_id = helper_country_state.id
LEFT JOIN client ON vacancy.client_id = client.id
LEFT JOIN entity_category ON entity_category.vacancy_id = vacancy.id
LEFT JOIN user_watching_list ON (user_watching_list.vacancy_id = vacancy.id AND user_watching_list.user_id = 7226)
WHERE vacancy.published_at IS NOT NULL
AND vacancy.flag_deleted <>1
AND vacancy.flag_active =1
AND vacancy.date_finish >= NOW()
AND client.flag_deleted <> 1
AND (vacancy.subject_id = 113 OR vacancy.offer_type_id = 1 OR vacancy.id IN (SELECT category_id FROM entity_category where vacancy_id = vacancy.id))
AND client.validated_at > '1900-01-01 00:00:00' GROUP BY vacancy.id ORDER BY sort1 ASC , sort2 ASC, sort3 ASC , title ASC