Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
8d6d49eb
提交
8d6d49eb
authored
8月 24, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor:优化页面查询速度
上级
596a6ef0
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
259 行增加
和
11 行删除
+259
-11
ExtChartGroupMapper.xml
.../java/io/dataease/base/mapper/ext/ExtChartGroupMapper.xml
+32
-1
ExtChartViewMapper.xml
...n/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
+32
-1
ExtDataSetGroupMapper.xml
...ava/io/dataease/base/mapper/ext/ExtDataSetGroupMapper.xml
+32
-1
ExtDataSetTableMapper.xml
...ava/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml
+32
-1
ExtDataSourceMapper.xml
.../java/io/dataease/base/mapper/ext/ExtDataSourceMapper.xml
+64
-2
ExtPanelGroupMapper.xml
.../java/io/dataease/base/mapper/ext/ExtPanelGroupMapper.xml
+67
-5
没有找到文件。
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartGroupMapper.xml
浏览文件 @
8d6d49eb
...
@@ -12,8 +12,39 @@
...
@@ -12,8 +12,39 @@
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
select
select
id, `name`, ifnull(pid,0) as pid, `level`, `type`, create_by, create_time,`name` as label,
id, `name`, ifnull(pid,0) as pid, `level`, `type`, create_by, create_time,`name` as label,
get_auths(id,'chart',#{userId})
as `privileges`
authInfo.privileges
as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_group
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_group
left join (
SELECT
auth_source,
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
FROM
(
`sys_auth`
LEFT JOIN `sys_auth_detail` ON ((
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
)))
WHERE
sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = 'chart'
AND (
(
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
)
OR (
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{userId}
)
OR (
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
)
)
GROUP BY
`sys_auth`.`auth_source`
) authInfo
on chart_group.id = authInfo.auth_source
<where>
<where>
FIND_IN_SET(chart_group.id,cids)
FIND_IN_SET(chart_group.id,cids)
<if
test=
"id != null"
>
<if
test=
"id != null"
>
...
...
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
浏览文件 @
8d6d49eb
...
@@ -32,8 +32,39 @@
...
@@ -32,8 +32,39 @@
select
select
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot,
style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot,
get_auths(id,'chart',#{userId})
as `privileges`
authInfo.privileges
as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_view
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'chart') cids) t,chart_view
left join (
SELECT
auth_source,
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
FROM
(
`sys_auth`
LEFT JOIN `sys_auth_detail` ON ((
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
)))
WHERE
sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = 'chart'
AND (
(
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
)
OR (
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{userId}
)
OR (
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
)
)
GROUP BY
`sys_auth`.`auth_source`
) authInfo
on chart_view.id = authInfo.auth_source
<where>
<where>
FIND_IN_SET(chart_view.id,cids)
FIND_IN_SET(chart_view.id,cids)
<if
test=
"sceneId != null"
>
<if
test=
"sceneId != null"
>
...
...
backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetGroupMapper.xml
浏览文件 @
8d6d49eb
...
@@ -12,8 +12,39 @@
...
@@ -12,8 +12,39 @@
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
select
select
id, `name`, ifnull(pid,0) as pid, `level`, `type`, create_by, create_time,`name` as label,
id, `name`, ifnull(pid,0) as pid, `level`, `type`, create_by, create_time,`name` as label,
get_auths(id,'dataset',#{userId})
as `privileges`
authInfo.privileges
as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'dataset') cids) t,dataset_group
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'dataset') cids) t,dataset_group
left join (
SELECT
auth_source,
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
FROM
(
`sys_auth`
LEFT JOIN `sys_auth_detail` ON ((
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
)))
WHERE
sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = 'dataset'
AND (
(
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
)
OR (
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{userId}
)
OR (
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
)
)
GROUP BY
`sys_auth`.`auth_source`
) authInfo
on dataset_group.id = authInfo.auth_source
<where>
<where>
FIND_IN_SET(dataset_group.id,cids)
FIND_IN_SET(dataset_group.id,cids)
<if
test=
"id != null"
>
<if
test=
"id != null"
>
...
...
backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml
浏览文件 @
8d6d49eb
...
@@ -38,8 +38,39 @@
...
@@ -38,8 +38,39 @@
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
select
select
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
get_auths(id,'dataset',#{userId})
as `privileges`
authInfo.privileges
as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'dataset') cids) t,dataset_table
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'dataset') cids) t,dataset_table
left join (
SELECT
auth_source,
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
FROM
(
`sys_auth`
LEFT JOIN `sys_auth_detail` ON ((
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
)))
WHERE
sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = 'dataset'
AND (
(
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
)
OR (
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{userId}
)
OR (
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
)
)
GROUP BY
`sys_auth`.`auth_source`
) authInfo
on dataset_table.id = authInfo.auth_source
<where>
<where>
FIND_IN_SET(dataset_table.id,cids)
FIND_IN_SET(dataset_table.id,cids)
<if
test=
"sceneId != null"
>
<if
test=
"sceneId != null"
>
...
...
backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSourceMapper.xml
浏览文件 @
8d6d49eb
...
@@ -9,8 +9,39 @@
...
@@ -9,8 +9,39 @@
<select
id=
"query"
parameterType=
"io.dataease.base.mapper.ext.query.GridExample"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"query"
parameterType=
"io.dataease.base.mapper.ext.query.GridExample"
resultMap=
"BaseResultMapDTO"
>
select id , name , `desc` ,`type` , configuration ,create_time ,update_time,
select id , name , `desc` ,`type` , configuration ,create_time ,update_time,
get_auths(id,'link',#{extendCondition})
as `privileges`
authInfo.privileges
as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{extendCondition}, 'link') cids) t,datasource
from (select GET_V_AUTH_MODEL_ID_P_USE (#{extendCondition}, 'link') cids) t,datasource
left join (
SELECT
auth_source,
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
FROM
(
`sys_auth`
LEFT JOIN `sys_auth_detail` ON ((
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
)))
WHERE
sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = 'link'
AND (
(
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{extendCondition} )
)
OR (
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{extendCondition}
)
OR (
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{extendCondition} )
)
)
GROUP BY
`sys_auth`.`auth_source`
) authInfo
on datasource.id = authInfo.auth_source
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"io.dataease.base.mapper.ext.query.GridSql.gridCondition"
/>
<include
refid=
"io.dataease.base.mapper.ext.query.GridSql.gridCondition"
/>
</if>
</if>
...
@@ -25,8 +56,39 @@
...
@@ -25,8 +56,39 @@
<select
id=
"queryUnion"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"queryUnion"
resultMap=
"BaseResultMapDTO"
>
select id , name , `desc` ,`type` , configuration ,create_time ,update_time, status,
select id , name , `desc` ,`type` , configuration ,create_time ,update_time, status,
get_auths(id,'link',#{userId})
as `privileges`
authInfo.privileges
as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'link') cids) t,datasource
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'link') cids) t,datasource
left join (
SELECT
auth_source,
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
FROM
(
`sys_auth`
LEFT JOIN `sys_auth_detail` ON ((
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
)))
WHERE
sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = 'chart'
AND (
(
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
)
OR (
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{userId}
)
OR (
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
)
)
GROUP BY
`sys_auth`.`auth_source`
) authInfo
on datasource.id = authInfo.auth_source
<where>
<where>
FIND_IN_SET(datasource.id,cids)
FIND_IN_SET(datasource.id,cids)
<if
test=
"id != null"
>
<if
test=
"id != null"
>
...
...
backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelGroupMapper.xml
浏览文件 @
8d6d49eb
...
@@ -30,10 +30,41 @@
...
@@ -30,10 +30,41 @@
panel_group.`source`,
panel_group.`source`,
panel_group.`panel_type`,
panel_group.`panel_type`,
sourcePanelGroup.`name` as source_panel_name,
sourcePanelGroup.`name` as source_panel_name,
get_auths(panel_group.id,'panel',#{userId})
as `privileges`
authInfo.privileges
as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
LEFT JOIN
(select id,`name` from panel_group)
sourcePanelGroup
LEFT JOIN
panel_group
sourcePanelGroup
on sourcePanelGroup.id=panel_group.source
on sourcePanelGroup.id=panel_group.source
left join (
SELECT
auth_source,
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
FROM
(
`sys_auth`
LEFT JOIN `sys_auth_detail` ON ((
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
)))
WHERE
sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = 'panel'
AND (
(
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
)
OR (
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{userId}
)
OR (
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
)
)
GROUP BY
`sys_auth`.`auth_source`
) authInfo
on panel_group.id = authInfo.auth_source
<where>
<where>
FIND_IN_SET(panel_group.id,cids)
FIND_IN_SET(panel_group.id,cids)
<if
test=
"name != null"
>
<if
test=
"name != null"
>
...
@@ -78,10 +109,41 @@
...
@@ -78,10 +109,41 @@
(case when ISNULL(defaultPanelGroup.id) then false else true end) is_default,
(case when ISNULL(defaultPanelGroup.id) then false else true end) is_default,
defaultPanelGroup.id as default_panel_id,
defaultPanelGroup.id as default_panel_id,
defaultPanelGroup.`name` as default_panel_name,
defaultPanelGroup.`name` as default_panel_name,
get_auths(panel_group.id,'panel',#{userId})
as `privileges`
authInfo.privileges
as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
LEFT JOIN (select source,id,`name` from panel_group where source is not null) defaultPanelGroup
LEFT JOIN panel_group defaultPanelGroup
on defaultPanelGroup.source=panel_group.id
on defaultPanelGroup.source=panel_group.id and defaultPanelGroup.source is not null
left join (
SELECT
auth_source,
group_concat( DISTINCT sys_auth_detail.privilege_extend ) as `privileges`
FROM
(
`sys_auth`
LEFT JOIN `sys_auth_detail` ON ((
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
)))
WHERE
sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = 'panel'
AND (
(
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target IN ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
)
OR (
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{userId}
)
OR (
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target IN ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
)
)
GROUP BY
`sys_auth`.`auth_source`
) authInfo
on panel_group.id = authInfo.auth_source
<where>
<where>
FIND_IN_SET(panel_group.id,cids)
FIND_IN_SET(panel_group.id,cids)
<if
test=
"name != null"
>
<if
test=
"name != null"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论