/*
 * *********************************************************************************************************************
 *
 *          !!
 *        .F88X
 *        X8888Y
 *      .}888888N;
 *        i888888N;        .:!              .I$WI:
 *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
 *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
 *            +888888N;  .8888888Y                                  "&&8Y.}8,
 *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
 *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
 *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
 *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
 *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
 *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
 *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
 *      .:R888888I
 *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
 *        ~8888'
 *        .!88~                                                                     All rights reserved.
 *
 * *********************************************************************************************************************
 */

package com.persagy.server.datacenter.models.entities.dictnew


import io.swagger.v3.oas.annotations.media.Schema
import java.io.Serializable
import javax.persistence.Column
import javax.persistence.Id
import javax.persistence.Table

/**
 * 平台对象信息点
 *
 * @author wx <zhangweixin@sagacloud.cn>
 * @date  2020/9/19 17:41
 */
@Schema(description = "平台对象信息点")
@Table(name = "dict.def_funcid")
open class DefFuncId: Serializable {

    /** 全局id */
    @Schema(description = "全局id")
    @Id
    @Column(name = "id")
    var id: String? = null

    /** 类型编码 */
    @Schema(description = "类型编码")
    @Id
    @Column(name = "class_code")
    var classCode: String? = null

    /** 动静分类:静态STATIC,脉冲PULSE,阶段GRADATION,时序SEQUENTIAL */
    @Schema(description = "动静分类:静态STATIC,脉冲PULSE,阶段GRADATION,时序SEQUENTIAL")
    @Column(name = "category")
    var category: String? = null

    /** 信息点编码 */
    @Schema(description = "信息点编码")
    @Id
    @Column(name = "code")
    var code: String? = null

    /** 信息点名称 */
    @Schema(description = "信息点名称")
    @Column(name = "name")
    var name: String? = null

    /** 分类:commo平台级, group集团级, project项目级 */
    @Schema(description = "分类:commo平台级, group集团级, project项目级")
    @Id
    @Column(name = "type")
    var type: String? = null

    /** 集团id, 默认为"0" */
    @Schema(description = "集团id, 默认为'0'")
    @Id
    @Column(name = "group_code")
    var groupCode: String? = null

    /** 项目id, 默认为"0" */
    @Schema(description = "项目id, 默认为'0'")
    @Id
    @Column(name = "project_id")
    var projectId: String? = null

    /** 数据类型 */
    @Schema(description = "数据类型")
    @Column(name = "data_type")
    var dataType: String? = null

    /** 数据格式 */
    @Schema(description = "数据格式")
    @Column(name = "formater")
    var formater: String? = null

    /** 数据格式 */
    @Schema(description = "数据格式")
    @Column(name = "data_source")
    var dataSource: ArrayList<Any?>? = null

    /** 输入方式 */
    @Schema(description = "输入方式")
    @Column(name = "input_mode")
    var inputMode: String? = null

    /** 一级标签 */
    @Schema(description = "一级标签")
    @Column(name = "first_tag")
    var firstTag: String? = null

    /** 一级名称 */
    @Schema(description = "一级名称")
    @Column(name = "first_name")
    var firstName: String? = null

    /** 二级标签 */
    @Schema(description = "二级标签")
    @Column(name = "second_tag")
    var secondTag: String? = null

    /** 二级名称 */
    @Schema(description = "二级名称")
    @Column(name = "second_name")
    var secondName: String? = null

    /** 序列 */
    @Schema(description = "序列")
    @Column(name = "idx")
    var idx: Int? = null

    /** 优先级,重要程度 */
    @Schema(description = "优先级,重要程度")
    @Column(name = "priority")
    var priority: String? = null

    /** 单位 */
    @Schema(description = "单位")
    @Column(name = "unit")
    var unit: String? = null

    /** 备注 */
    @Schema(description = "备注")
    @Column(name = "note")
    var note: String? = null

    /** 输入类型 */
    @Schema(description = "输入类型")
    @Column(name = "orig_data_type")
    var origDataType: String? = null

    /** 旧信息点编码 */
    @Schema(description = "旧信息点编码")
    @Column(name = "orig_code")
    var origCode: String? = null

    /** 别编码 */
    @Schema(description = "别编码")
    @Column(name = "alias_code")
    var aliasCode: String? = null

    /** 别名称 */
    @Schema(description = "别名称")
    @Column(name = "alias_name")
    var aliasName: String? = null

    /** 是否分类标签 */
    @Schema(description = "是否分类标签")
    @Column(name = "can_sub")
    var canSub: Boolean? = null

    /** 是否复数 */
    @Schema(description = "是否复数")
    @Column(name = "is_multiple")
    var isMultiple: Boolean? = null

    /** 是否区间 */
    @Schema(description = "是否区间")
    @Column(name = "is_region")
    var isRegion: Boolean? = null

    /** 子分类标记 */
    @Schema(description = "子分类标记")
    @Column(name = "sub_flag")
    var subFlag: Boolean? = null

    /** 是否只读, 如果是则不允许对该信息点做变更 */
    @Schema(description = "是否只读, 如果是则不允许对该信息点做变更")
    @Column(name = "readonly")
    var readonly: Boolean? = null

    /** 排序 */
    @Schema(description = "排序")
    @Column(name = "sort")
    var sort: Int? = null

    /** 是否显示 */
    @Schema(description = "是否显示")
    @Column(name = "visible")
    var visible: Boolean? = null

    /** 是否编辑 */
    @Schema(description = "是否编辑")
    @Column(name = "editable")
    var editable: Boolean? = null

    /** 禁止操作 */
    @Schema(description = "禁止操作")
    @Column(name = "un_disabled")
    var unDisabled: Boolean? = null

    /** 关键信息点 */
    @Schema(description = "关键信息点")
    @Column(name = "key_word")
    var keyWord: Boolean? = null

    /** 路径 */
    @Schema(description = "路径")
    var path: String? = null
        get() {
            return if (firstName == "基本信息"|| firstName.isNullOrEmpty()||firstName == "基本参数"){
                code
            }else{
                "infos.$code"
            }
        }

    /** 字典内容 */
    @Schema(description = "字典内容")
    var content: ArrayList<DefFuncId>? = null

}