package cn.cslg.pas.domain;

import cn.cslg.pas.common.model.SuperEntity;
import cn.cslg.pas.common.model.dto.analysis.SchemaDimensionDTO;
import cn.cslg.pas.common.model.dto.analysis.SourceDataDTO;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.List;

/**
 * <p>
 * 自定义分析项目
 * </p>
 *
 * @author 王岩
 * @since 2021-12-23
 */
@Data
@TableName("os_custom_analysis_item")
public class CustomAnalysisItem extends SuperEntity<CustomAnalysisItem> {

    /**
     * UID
     */
    private String uid;

    /**
     * 名称
     */
    private String name;

    /**
     * 创建者
     */
    private Integer createBy;

    /**
     * 父节点
     */
    private Integer parentId;

    /**
     * 可见类型
     */
    private Integer permissions;

    /**
     * 专题库ID
     */
    private Integer projectId;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 类型
     */
    private Integer type;

    /**
     * 备注
     */
    private String remark;

    /**
     * 子节点
     */
    @TableField(exist = false)
    private List<CustomAnalysisItem> children;

    /**
     * 维度数据
     */
    @TableField(exist = false)
    private SchemaDimensionDTO schema;

    /**
     * 图表设置
     */
    @TableField(exist = false)
    private CustomAnalysisItemSetting setting;

    /**
     * 数据源
     */
    @TableField(exist = false)
    private SourceDataDTO source;

    @TableField(exist = false)
    private String parentName;

    public CustomAnalysisItem() {
        this.schema = new SchemaDimensionDTO();
        this.setting = new CustomAnalysisItemSetting();
        this.source = new SourceDataDTO();
    }
}
