package cn.sagacloud.server.datacenter.models.entities.graphtype

import cn.sagacloud.server.datacenter.models.entities.Equipment
import cn.sagacloud.server.datacenter.models.entities.base.RBaseInfo
import com.alibaba.fastjson.annotation.JSONField
import com.sybotan.service.models.annotations.SCascade
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.util.*
import javax.persistence.Column
import javax.persistence.Id
import javax.persistence.Table
import kotlin.collections.ArrayList

/**
 * 图类型
 *
 * @author  邓婷婷
 */
@ApiModel(description = "图类型实体类")
@Table(name = "graphtype.graphic_type")
open class GraphicType : RBaseInfo() {

    /** 图类型id */
    @ApiModelProperty(value = "图类型id")
    @Id
    @Column(name = "id")
    @JSONField(name = "GraphTypeId")
    var graphTypeId: String? = null


    /** 图类型名称 */
    @ApiModelProperty(value = "图类型名称")
    @Column(name = "name")
    @JSONField(name = "GraphTypeName")
    var graphTypeName: String? = null

    /** 图类型编码 */
    @ApiModelProperty(value = "图类型编码")
    @Column(name = "code")
    @JSONField(name = "GraphTypeCode")
    var graphTypeCode: String? = null

    /** 说明 */
    @ApiModelProperty(value = "说明")
    @Column(name = "note")
    @JSONField(name = "Note")
    var note: String? = null

    /** 父id */
    @ApiModelProperty(value = "父id")
    @Column(name = "parent_id")
    @JSONField(name = "ParentId")
    var parentId: String? = null

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

    /** 级联-图类型   table  对应关系表   idColumn 对应 本类的id    childIdColumn 级联对象的关系id */
    @ApiModelProperty(value = "级联-图类型")
    @SCascade(table="graphtype.graphic_type", idColumn="parent_id", childIdColumn="id")
    @JSONField(name = "ChildGraphicTypeList")
    var childGraphicTypeList: ArrayList<GraphicType>? = null

    /** 级联-状态信息 */
    @ApiModelProperty(value = "级联-状态信息")
//    @SCascade(table="graphtype.relation_type_project", idColumn="graphic_id", childIdColumn="id")
    @JSONField(name = "RelationTypeProjectList")
    var relationTypeProjectList: ArrayList<RelationTypeProject>? = null

} // Class ScanTask