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

import com.alibaba.fastjson.annotation.JSONField
import com.persagy.service.models.SBaseEntity
import com.persagy.service.models.annotations.SCascade
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.io.Serializable
import javax.persistence.Column
import javax.persistence.Id
import javax.persistence.Table

/**
 * 业务空间类型
 */
@ApiModel(description = "业务空间类型")
@Table(name = "dict.dict_space_project")
class DictSpaceProject: SBaseEntity(),Serializable {

    /** 编码 */
    @ApiModelProperty(value = "编码")
    @Id
    @Column(name = "id")
    @JSONField(name = "Code")
    var id: String? = null

    /** 名称 */
    @ApiModelProperty(value = "名称")
    @Column(name = "name")
    @JSONField(name = "Name")
    var name: String? = null

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

    /** 项目id */
    @ApiModelProperty(value = "项目id")
    @Id
    @Column(name = "project_id")
    @JSONField(name = "ProjectId")
    var projectId: String? = null

    /** 标记 */
    @ApiModelProperty(value = "标记")
    @Column(name = "sign")
    @JSONField(name = "Sign")
    var sign: Int? = null

    /** 数量 */
    @ApiModelProperty(value = "数量")
    @JSONField(name = "Count")
    var count: Int? = 0

    /** 级联-设备所在的竖井 */
    @ApiModelProperty(value = "级联-设备所在的竖井")
    @SCascade(table="dict.dict_space_project", idColumn="parent_id", childIdColumn="id")
    @JSONField(name = "ZoneType")
    var zoneType: ArrayList<DictSpaceProject>? = null

} // Class DictSpaceProject