SELECT 
obj_main.isys_obj__id AS '__id__', 
(CONCAT(obj_main.isys_obj__title, ' {', obj_main.isys_obj__id, '}')   ) 'isys_cmdb_dao_category_g_global__title', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(isys_model_manufacturer__title SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '') FROM isys_catg_model_list 
                INNER JOIN isys_model_manufacturer ON isys_model_manufacturer__id = isys_catg_model_list__isys_model_manufacturer__id  WHERE isys_catg_model_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_model_list__status = 2   GROUP BY isys_catg_model_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_model__manufacturer', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(isys_model_title__title SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '') FROM isys_catg_model_list 
                INNER JOIN isys_model_title ON isys_model_title__id = isys_catg_model_list__isys_model_title__id  WHERE isys_catg_model_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_model_list__status = 2   GROUP BY isys_catg_model_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_model__title', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(isys_catg_model_list__serial SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '') FROM isys_catg_model_list  WHERE isys_catg_model_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_model_list__status = 2   GROUP BY isys_catg_model_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_model__serial', 
(SELECT isys_obj__id FROM isys_catg_location_list  WHERE isys_catg_location_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_location_list__status = 2   ) 'isys_cmdb_dao_category_g_location__location_path', 
(SELECT CONCAT("{", isys_cmdb_status__color, "} ", isys_cmdb_status__title) FROM isys_cmdb_status  WHERE obj_main.isys_obj__isys_cmdb_status__id = isys_cmdb_status__id  AND isys_cmdb_status__status = 2   ) 'isys_cmdb_dao_category_g_global__cmdb_status', 
(SELECT
                            CONCAT(isys_obj__title, ' {', isys_obj__id, '}')
                            FROM isys_catg_contact_list
                            INNER JOIN isys_connection ON isys_connection__id = isys_catg_contact_list__isys_connection__id AND isys_catg_contact_list__primary_contact = 1
                            INNER JOIN isys_obj ON isys_obj__id = isys_connection__isys_obj__id  WHERE isys_catg_contact_list__primary_contact = 1  AND isys_catg_contact_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_contact_list__status = 2   LIMIT 1) 'isys_cmdb_dao_category_g_contact__primary_contact' 

FROM isys_obj AS obj_main 
 

WHERE TRUE 
AND obj_main.isys_obj__isys_obj_type__id = 22 
