select name from cr_items where parent_id = :party_id select groups.group_id, groups.group_name, ( select count(distinct gamm.member_id) from group_approved_member_map gamm where gamm.group_id = groups.group_id ) as member_count, ( select count(distinct gcm.component_id) from group_component_map gcm where gcm.group_id = groups.group_id) as component_count, CASE WHEN package_id is not null THEN '1' ELSE '0' END as mapped_p, CASE WHEN default_p THEN '1' ELSE '0' END as default_p from groups left join contact_groups on ( groups.group_id = contact_groups.group_id ) where groups.group_id != '-1' and groups.group_id not in ( select gcm.component_id from group_component_map gcm where gcm.group_id != -1 ) and acs_permission__permission_p(groups.group_id,:user_id,:privilege_required) order by CASE WHEN contact_groups.default_p THEN '000000000' ELSE upper(groups.group_name) END select groups.group_id, groups.group_name, ( select count(distinct gamm.member_id) from group_approved_member_map gamm where gamm.group_id = groups.group_id ) as member_count, CASE WHEN package_id is not null THEN '1' ELSE '0' END as mapped_p, CASE WHEN default_p THEN '1' ELSE '0' END as default_p from groups left join contact_groups on ( groups.group_id = contact_groups.group_id ), group_component_map where group_component_map.group_id = :group_id and group_component_map.component_id = groups.group_id order by upper(groups.group_name) select group_id from group_component_map where component_id = :group_id and group_id != '-1' select acs_group__new ( :group_id, 'group', now(), :creation_user, :creation_ip, :email, :url, :group_name, :join_policy, :context_id ) insert into contact_groups (group_id,owner_id,group_type,deprecated_p,package_id) values (:group_id,:owner_id,:group_type,:deprecated_p,:package_id)