This should be done ... with the exception of the double dash "-" prefix to the name ...
SELECT
t1.name,
t1.id
FROM
Table1 t1
ORDER BY
case when t1.parentID = 0 then t1.ID else t1.ParentID end,
case when t1.parentID = 0 then '1' else '2' end,
t1.id
FIRST case/ , . , * 1000 , 1000 . SECOND case/when , ID = 0 TOP , .
, ,
SELECT
if( t1.ParentID = 0, '', '--' ) + t1.name name,
<rest of query is the same>