@Select("select 'sys_struct_dict' node_type,id,'' parent_id,struct_name title from sys_struct_dict ssd where ssd.depart_id = #{departId}\n"+
"union all\n"+
"select 'equip_info' node_type,ei.id,ssd.id parent_id,ei.equipment_name title from equipment_info ei left join sys_struct_dict ssd on "+
" ei.structures = ssd.id where ssd.depart_id = #{departId}")
@Select("SELECT * FROM\t(\tSELECT 'sys_struct_dict' AS node_type,ssd.id,'' AS parent_id,ssd.struct_name AS title,ssd.sort_num,NULL AS equipment_name\n"+
"\tFROM sys_struct_dict ssd WHERE ssd.depart_id = #{departId}\n"+
"\tUNION ALL SELECT\n"+
"\t\t'equip_info' AS node_type,ei.id,ssd.id AS parent_id,ei.equipment_name AS title,ssd.sort_num,ei.equipment_name -- 用于排序\n"+
"\tFROM equipment_info ei LEFT JOIN sys_struct_dict ssd ON ei.structures = ssd.id \n"+
"\tWHERE ssd.depart_id = #{departId}\n"+
"\t) AS combined_result ORDER BY node_type DESC,sort_num,equipment_name;")