sql:
SELECT [id]
,[parentId]
,[name]
,[code]
,[isDisplay]
,[description]
,[isSystem]
FROM [jxwpgsh].[dbo].[SYS_DICTIONARY]
order by len([code]),[code]
hql:
from SysDictionary d where d.parentId=? order by length(d.code),d.code