/*
 * ********************************************************************************************************************
 *
 *                     :*$@@%$*:                         ;:                ;;    ;;
 *                   :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
 *                  :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
 *                  =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
 *                  =@*                                  %!              @ $= % %@=   =%@!      %=
 *             *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
 *           %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
 *         ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
 *         $@*   ;@@@%=!:                *@*
 *         =@$    ;;;!=%@@@@=!           =@!
 *          %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
 *           ;%@@$=$@@%*       *@@@$=%@@%;
 *              ::;::             ::;::                                              All rights reserved.
 *
 * ********************************************************************************************************************
 */

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

import cn.sagacloud.server.datacenter.models.entities.base.BaseInfo
import cn.sagacloud.server.datacenter.models.entities.task.TaskPic
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.io.Serializable
import javax.persistence.Column
import javax.persistence.Id
import javax.persistence.Table

/**
 * 空间父类
 *
 * @author  张维新
 */
@ApiModel(description = "空间父类实体类")
@Table(name = "zone_space_base")
open class ZoneSpaceBaseTable: Serializable, BaseInfo() {

    /** 空间ID */
    @ApiModelProperty(value = "空间ID")
    @Id
    @Column(name = "id")
    @JSONField(name = "RoomID")
    var id: String? = null

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

    /** 空间本地编码 */
    @ApiModelProperty(value = "空间本地编码")
    @Column(name = "local_id")
    @JSONField(name = "RoomLocalID")
    var localId: String? = null

    /** 空间本地名称 */
    @ApiModelProperty(value = "空间本地名称")
    @Column(name = "local_name")
    @JSONField(name = "RoomLocalName")
    var localName: String? = null

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

    /** 建筑id */
    @ApiModelProperty(value = "建筑id")
    @Column(name = "building_id")
    @JSONField(name = "BuildingId")
    var buildingId: String? = null

    /** 楼层id */
    @ApiModelProperty(value = "楼层id")
    @Column(name = "floor_id")
    @JSONField(name = "FloorId")
    var floorId: String? = null

    /** 空间二维码图片 */
    @ApiModelProperty(value = "空间二维码图片")
    @Column(name = "qr_code")
    @JSONField(name = "RoomQRCode")
    var qrCode: String? = null

    /** 平台二维码 */
    @ApiModelProperty(value = "平台二维码")
    @Column(name = "default_qr_code")
    @JSONField(name = "DefaultQRCode")
    var defaultQRCode: String? = null

    /** BIM模型中编码 */
    @ApiModelProperty(value = "BIM模型中编码")
    @Column(name = "bim_id")
    @JSONField(name = "BIMID")
    var bimId: String? = null

    /** 轮廓线 */
    @ApiModelProperty(value = "轮廓线")
    @Column(name = "outline")
    @JSONField(name = "Outline")
    var outline: ArrayList<ArrayList<ArrayList<PointPosition>>>? = null

    /** 轮廓线2 */
    @ApiModelProperty(value = "轮廓线2")
    @Column(name = "outline2")
    @JSONField(name = "Outline2")
    var outline2: ArrayList<ArrayList<ArrayList<PointPosition>>>? = null

    /** 图片  */
    @ApiModelProperty(value = "图片 ")
    @Column(name = "pic")
    @JSONField(name = "Pic")
    var pic: ArrayList<TaskPic>? =null

    /** 空间是否受影响  */
    @ApiModelProperty(value = "空间是否受影响 1受影响 0不受影响 ")
    @Column(name = "state")
    @JSONField(name = "State")
    var state: Int? =null

    /** 级联-建筑 */
    @ApiModelProperty(value = "级联-建筑")
    @SCascade(table="zone_space_base", idColumn="id", childIdColumn="building_id")
    @JSONField(name = "Building")
    var building: Building? = null

    /** 级联-楼层  */
    @ApiModelProperty(value = "级联-楼层")
    @SCascade(table="zone_space_base", idColumn="id", childIdColumn="floor_id")
    @JSONField(name = "Floor")
    var floor: Floor? = null

    /** 级联-空间类型  */
    @ApiModelProperty(value = "级联-空间类型")
    @SCascade(table="zone_space_base", idColumn="id", childIdColumn="object_type")
    @JSONField(name = "DClassDef")
    var zoneName: DClassDef? = null

    /** 级联-建筑 */
    @ApiModelProperty(value = "级联-建筑")
    @SCascade(table="r_sp_in_bd", idColumn="space_id", childIdColumn="building_id")
    @JSONField(name = "BuildingList")
    var buildingList: ArrayList<Building>? = null

    /** 级联-楼层  */
    @ApiModelProperty(value = "级联-楼层")
    @SCascade(table="r_sp_in_fl", idColumn="space_id", childIdColumn="floor_id")
    @JSONField(name = "FloorList")
    var floorlList: ArrayList<Floor>? = null


} // Class ZoneAirConditioning