Для всех рефов
SELECT `t1`.`id`, `t1`.`name`, COUNT(`t2`.`id`) AS cnt
FROM `table` as `t1`
LEFT JOIN `table` `t2` ON `t1`.`id` = `t2`.`ref_id`
WHERE (`t1`.`param1` + `t1`.`param2` + `t1`.`param3`) > 5
GROUP BY `t1`.`id`
ORDER BY cnt DESC
Для рефов с param1 + param 2 + param 3 > 5
SELECT `t1`.`id`, `t1`.`name`, COUNT(`t2`.`id`) AS cnt
FROM `table` as `t1`
LEFT JOIN `table` `t2` ON `t1`.`id` = `t2`.`ref_id`
AND (`t2`.`param1` + `t2`.`param2` + `t2`.`param3`) > 5
WHERE (`t1`.`param1` + `t1`.`param2` + `t1`.`param3`) > 5
GROUP BY `t1`.`id` ORDER BY cnt DESC