UnisKB/apps/application/sql/list_application_user.sql

31 lines
952 B
MySQL
Raw Normal View History

2025-05-28 10:57:09 +00:00
select *
from (select "id"::text,
"name",
"desc",
"is_publish",
"type",
'application' as "resource_type",
"workspace_id",
"folder_id",
"user_id",
"create_time",
"update_time"
from application
where id in (select target
from workspace_user_resource_permission
where auth_target_type = 'APPLICATION'
2025-06-11 04:21:13 +00:00
and 'VIEW' = any (permission_list))
2025-05-28 10:57:09 +00:00
UNION
select "id",
"name",
"desc",
2025-06-11 04:21:13 +00:00
true as "is_publish",
2025-05-28 10:57:09 +00:00
'folder' as "type",
'folder' as "resource_type",
2025-06-11 04:21:13 +00:00
"workspace_id",
"parent_id" as "folder_id",
2025-05-28 10:57:09 +00:00
"user_id",
"create_time",
"update_time"
from application_folder ${folder_query_set}) temp
${application_query_set}