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 isys_cats_net_ip_addresses_list__title
                              FROM isys_catg_ip_list
                                INNER JOIN isys_cats_net_ip_addresses_list ON isys_catg_ip_list__isys_cats_net_ip_addresses_list__id = isys_cats_net_ip_addresses_list__id  WHERE isys_catg_ip_list__primary = 1  AND isys_catg_ip_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_ip_list__status = 2   LIMIT 1) 'isys_cmdb_dao_category_g_ip__primary_hostaddress', 
(SELECT isys_catg_ip_list__hostname
                              FROM isys_catg_ip_list  WHERE isys_catg_ip_list__primary = 1  AND isys_catg_ip_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_ip_list__status = 2   LIMIT 1) 'isys_cmdb_dao_category_g_ip__primary_hostname', 
(SELECT REPLACE(CONCAT('<ul><li>', SUBSTRING_INDEX(GROUP_CONCAT(isys_cats_net_ip_addresses_list__title SEPARATOR '</li><li>'), '</li><li>', 5), '</li></ul>'), '<ul><li></li></ul>', '')
                              FROM isys_catg_ip_list
                                INNER JOIN isys_cats_net_ip_addresses_list ON isys_catg_ip_list__isys_cats_net_ip_addresses_list__id = isys_cats_net_ip_addresses_list__id  WHERE isys_catg_ip_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_ip_list__status = 2   GROUP BY isys_catg_ip_list__isys_obj__id  LIMIT 5) 'isys_cmdb_dao_category_g_ip__all_ips', 
(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', 
(CONCAT(DATE_FORMAT(obj_main.isys_obj__created, '%d.%m.%Y %H:%i:%s'), ' (' , obj_main.isys_obj__created_by, ')')   ) 'isys_cmdb_dao_category_g_global__created' 

FROM isys_obj AS obj_main 
 

WHERE TRUE 
AND obj_main.isys_obj__isys_obj_type__id = 7 
