SELECT 
obj_main.isys_obj__id AS '__id__', 
(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(obj_main.isys_obj__title, ' {', obj_main.isys_obj__id, '}')   ) 'isys_cmdb_dao_category_g_global__title', 
obj_main.isys_obj__description 'isys_cmdb_dao_category_g_global__description', 
j3.isys_cats_person_group_list__ldap_group 'isys_cmdb_dao_category_s_person_group_master__ldap_group', 
(CONCAT(DATE_FORMAT(obj_main.isys_obj__updated, '%d.%m.%Y %H:%i:%s'), ' (' , obj_main.isys_obj__updated_by, ')')   ) 'isys_cmdb_dao_category_g_global__changed', 
(SELECT COUNT(isys_person_2_group__isys_obj__id__person)
                            FROM isys_person_2_group
                            INNER JOIN isys_obj ON isys_obj__id = isys_person_2_group__isys_obj__id__person AND isys_obj__status = 2  WHERE isys_person_2_group__isys_obj__id__group = obj_main.isys_obj__id   ) 'isys_cmdb_dao_category_s_person_group_members__membersCount', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(CONCAT((CASE WHEN isys_obj__title = '' THEN isys_cats_person_list__title ELSE isys_obj__title END),  ' {', isys_obj__id, '}') SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '')
                            FROM isys_person_2_group
                            INNER JOIN isys_obj ON isys_obj__id = isys_person_2_group__isys_obj__id__person AND isys_obj__status = 2
                            LEFT JOIN isys_cats_person_list ON isys_obj__id = isys_cats_person_list__isys_obj__id  WHERE isys_person_2_group__isys_obj__id__group = obj_main.isys_obj__id   GROUP BY isys_person_2_group__isys_obj__id__group  ) 'isys_cmdb_dao_category_s_person_group_members__members' 

FROM isys_obj AS obj_main 
LEFT JOIN isys_cats_person_group_list AS j3 ON j3.isys_cats_person_group_list__isys_obj__id = obj_main.isys_obj__id AND j3.isys_cats_person_group_list__status = 2 

WHERE TRUE 
AND obj_main.isys_obj__isys_obj_type__id = 54 
