80 lines
2.5 KiB
Java
80 lines
2.5 KiB
Java
package com.muyu.domain;
|
|
|
|
import com.baomidou.mybatisplus.annotation.IdType;
|
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
import com.muyu.common.core.annotation.Excel;
|
|
import com.muyu.common.core.web.domain.BaseEntity;
|
|
import com.muyu.domain.rep.TableInfoRep;
|
|
import com.muyu.domain.rep.TableInfoResp;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Data;
|
|
import lombok.EqualsAndHashCode;
|
|
import lombok.NoArgsConstructor;
|
|
import lombok.experimental.SuperBuilder;
|
|
|
|
@Data
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@SuperBuilder
|
|
@EqualsAndHashCode(callSuper = true)
|
|
@TableName(value ="table_info") //数据库表相关
|
|
public class TableInfo extends BaseEntity {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
/** 主键 */
|
|
@TableId(value = "id", type = IdType.AUTO)
|
|
private Long id;
|
|
|
|
private Long basicId;
|
|
|
|
/** 表名称/数据库 */
|
|
@Excel(name = "表名称/数据库")
|
|
private String tableName;
|
|
|
|
/** 表备注 */
|
|
@Excel(name = "表备注")
|
|
private String tableRemark;
|
|
|
|
/** 表备注 */
|
|
@Excel(name = "数据来源类型")
|
|
private String type;
|
|
|
|
/** 数据量 */
|
|
@Excel(name = "数据量")
|
|
private Long dataNum;
|
|
|
|
/** 是否核心 'Y'是 'N'不是 */
|
|
@Excel(name = "是否核心 'Y'是 'N'不是")
|
|
private String center;
|
|
|
|
private Long parentId;
|
|
|
|
|
|
public static TableInfoRep tableInfoRep(TableInfo tableInfo){
|
|
return TableInfoRep.builder()
|
|
.id(tableInfo.getId())
|
|
.basicId(tableInfo.getBasicId())
|
|
.tableName(tableInfo.getTableName())
|
|
.tableRemark(tableInfo.getTableRemark())
|
|
.type(tableInfo.getType())
|
|
.center(tableInfo.getCenter())
|
|
.parentId(tableInfo.getParentId())
|
|
.dataNum(tableInfo.getDataNum())
|
|
.build();
|
|
}
|
|
|
|
public static TableInfoResp toTableInfoResp(TableInfo tableInfo) {
|
|
return TableInfoResp.builder()
|
|
.id(tableInfo.id)
|
|
.tableName(tableInfo.tableName)
|
|
.tableRemark(tableInfo.tableRemark)
|
|
.isCenter(tableInfo.center)
|
|
.dataNum(tableInfo.dataNum)
|
|
.build();
|
|
}
|
|
|
|
|
|
}
|