refactor(数据集): 数据集信息界面创建人显示为别名
This commit is contained in:
parent
ead9940bf2
commit
6b885857ad
@ -1,5 +1,6 @@
|
||||
package io.dataease.controller.response;
|
||||
|
||||
import io.dataease.dto.dataset.DataSetTableDTO;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTable;
|
||||
import io.dataease.plugins.common.base.domain.Datasource;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -8,7 +9,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class DataSetDetail {
|
||||
@ApiModelProperty("数据集")
|
||||
private DatasetTable table;
|
||||
private DataSetTableDTO table;
|
||||
@ApiModelProperty("数据源")
|
||||
private Datasource datasource;
|
||||
}
|
||||
|
||||
@ -22,4 +22,6 @@ public class DataSetTableDTO extends DatasetTable {
|
||||
private Boolean isLeaf;
|
||||
@ApiModelProperty("父ID")
|
||||
private String pid;
|
||||
@ApiModelProperty("创建者姓名")
|
||||
private String creatorName;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ public interface ExtDataSetTableMapper {
|
||||
List<DataSetTableDTO> search(DataSetTableRequest request);
|
||||
|
||||
DataSetTableDTO searchOne(DataSetTableRequest request);
|
||||
|
||||
DataSetTableDTO findOneDetails(@Param("datasetTableId") String datasetTableId);
|
||||
List<DataSetTableDTO> searchDataSetTableWithPanelId(@Param("panelId") String panelId, @Param("userId") String userId);
|
||||
List<DatasetTable> findByPanelId(@Param("panelId") String panelId);
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
extends="io.dataease.plugins.common.base.mapper.DatasetTableMapper.BaseResultMap">
|
||||
<result column="privileges" property="privileges"/>
|
||||
<result column="sql_variable_details" property="sqlVariableDetails"/>
|
||||
<result column="creator_name" property="creatorName"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
@ -14,9 +15,25 @@
|
||||
<result property="name" column="name"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="findOneDetails" resultMap="BaseResultMapDTO">
|
||||
select id,
|
||||
`name`,
|
||||
scene_id,
|
||||
data_source_id,
|
||||
`type`,
|
||||
`mode`,
|
||||
`info`,
|
||||
create_by,
|
||||
create_time,
|
||||
( SELECT nick_name FROM sys_user WHERE sys_user.username = dataset_table.create_by ) AS creator_name
|
||||
from dataset_table
|
||||
where id = #{datasetTableId}
|
||||
</select>
|
||||
|
||||
<select id="searchOne" resultMap="BaseResultMapDTO">
|
||||
select
|
||||
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
|
||||
( SELECT nick_name FROM sys_user WHERE sys_user.username = dataset_table.create_by ) AS creator_name,
|
||||
get_auths(id,'dataset',#{userId}) as `privileges`, scene_id as pid, sql_variable_details
|
||||
from dataset_table
|
||||
<where>
|
||||
@ -103,45 +120,31 @@
|
||||
|
||||
|
||||
<select id="searchDataSetTableWithPanelId" resultMap="BaseResultMapDTO">
|
||||
select
|
||||
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
|
||||
get_auths(id,'dataset',#{userId}) as `privileges`
|
||||
select id,
|
||||
`name`,
|
||||
scene_id,
|
||||
data_source_id,
|
||||
`type`,
|
||||
`mode`,
|
||||
`info`,
|
||||
create_by,
|
||||
create_time,
|
||||
get_auths(id, 'dataset', #{userId}) as `privileges`
|
||||
from dataset_table
|
||||
where id in (
|
||||
SELECT
|
||||
table_id
|
||||
FROM
|
||||
chart_view
|
||||
WHERE
|
||||
id IN (
|
||||
SELECT
|
||||
chart_view_id
|
||||
FROM
|
||||
panel_view
|
||||
WHERE
|
||||
panel_id = #{panelId}
|
||||
)
|
||||
)
|
||||
where id in (SELECT table_id
|
||||
FROM chart_view
|
||||
WHERE id IN (SELECT chart_view_id
|
||||
FROM panel_view
|
||||
WHERE panel_id = #{panelId}))
|
||||
</select>
|
||||
|
||||
<select id="findByPanelId" resultMap="BaseResultMapDTO">
|
||||
select
|
||||
dataset_table.*
|
||||
select dataset_table.*
|
||||
from dataset_table
|
||||
where id in (
|
||||
SELECT
|
||||
table_id
|
||||
FROM
|
||||
chart_view
|
||||
WHERE
|
||||
id IN (
|
||||
SELECT
|
||||
chart_view_id
|
||||
FROM
|
||||
panel_view
|
||||
WHERE
|
||||
panel_id = #{panelId}
|
||||
)
|
||||
)
|
||||
where id in (SELECT table_id
|
||||
FROM chart_view
|
||||
WHERE id IN (SELECT chart_view_id
|
||||
FROM panel_view
|
||||
WHERE panel_id = #{panelId}))
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -2190,7 +2190,7 @@ public class DataSetTableService {
|
||||
|
||||
public DataSetDetail getDatasetDetail(String id) {
|
||||
DataSetDetail dataSetDetail = new DataSetDetail();
|
||||
DatasetTable table = datasetTableMapper.selectByPrimaryKey(id);
|
||||
DataSetTableDTO table = extDataSetTableMapper.findOneDetails(id);
|
||||
dataSetDetail.setTable(table);
|
||||
if (ObjectUtils.isNotEmpty(table)) {
|
||||
Datasource datasource = datasourceMapper.selectByPrimaryKey(table.getDataSourceId());
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<p class="info-title">{{ $t('dataset.create_by') }}</p>
|
||||
<p class="info-content">{{ detail.table.createBy }}</p>
|
||||
<p class="info-content">{{ detail.table.creatorName || 'N/A' }}</p>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<p class="info-title">{{ $t('dataset.create_time') }}</p>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
</span>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<span class="create-by">{{ $t('dataset.create_by') }}</span>
|
||||
<span class="create-by">:{{ table.createBy }}</span>
|
||||
<span class="create-by">:{{ table.creatorName || 'N/A' }}</span>
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
width="420"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user