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

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

import cn.sagacloud.server.datacenter.models.entities.task.TaskPic
import com.alibaba.fastjson.annotation.JSONField
import com.sybotan.service.models.SBaseEntity
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 ZoneSpace: Serializable, SBaseEntity() {


    /** 空间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

    /** BIM模型中坐标 */
    @ApiModelProperty(value = "BIM模型中坐标")
    @Column(name = "bim_location")
    @JSONField(name = "BIMLocation")
    var bimLocation: String? = null

    /** 进深 */
    @ApiModelProperty(value = "进深")
    @Column(name = "depth")
    @JSONField(name = "Depth")
    var depth: Double? = null

    /** 面宽 */
    @ApiModelProperty(value = "面宽")
    @Column(name = "width")
    @JSONField(name = "Width")
    var width: Double? = null

    /** 建筑面积 */
    @ApiModelProperty(value = "建筑面积")
    @Column(name = "build_area")
    @JSONField(name = "BuildArea")
    var buildArea: Double? = null

    /** 使用面积 */
    @ApiModelProperty(value = "使用面积")
    @Column(name = "net_area")
    @JSONField(name = "NetArea")
    var netArea: Double? =null

    /** 高度 */
    @ApiModelProperty(value = "高度")
    @Column(name = "height")
    @JSONField(name = "Height")
    var height: Double? = null

    /** 备注文字 */
    @ApiModelProperty(value = "备注文字")
    @Column(name = "intro")
    @JSONField(name = "Intro")
    var intro: String? =null

    /** 设计供冷功率*/
    @ApiModelProperty(value = "设计供冷功率 ")
    @Column(name = "rated_coolingp")
    @JSONField(name = "RatedCoolingP")
    var ratedCoolingP: Double? =null

    /** 设计供热功率 */
    @ApiModelProperty(value = "设计供热功率 ")
    @Column(name = "rated_heatingp")
    @JSONField(name = "RatedHeatingP")
    var ratedHeatingP: Double? =null

    /** 设计供热功率 */
    @ApiModelProperty(value = "设计供热功率 ")
    @Column(name = "ac_type")
    @JSONField(name = "ACType")
    var acType: String? =null

    /** 空间朝向 */
    @ApiModelProperty(value = "空间朝向")
    @Column(name = "zone_orientation")
    @JSONField(name = "ZoneOrientation")
    var zoneOrientation: String? = null

    /** 空间功能区类型 */
    @ApiModelProperty(value = "空间功能区类型")
    @Column(name = "func_type")
    @JSONField(name = "RoomFuncType")
    var funcType: String? = null

    /** 运行参数  */
    @ApiModelProperty(value = "运行参数 ")
    @Column(name = "run_param")
    @JSONField(name = "RunParam")
    var runParam: HashMap<String,Any?>? =null

    /** 自定义 */
    @ApiModelProperty(value = "自定义")
    @Column(name = "custom_param")
    @JSONField(name = "CustomParam")
    var customParam: java.util.HashMap<String, Any?>? = null

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

    /** 空间序号  */
    @ApiModelProperty(value = "空间序号 ")
    @Column(name = "room_serial")
    @JSONField(name = "RoomSerial")
    var roomSerial: Double? =null

    /** 项目空间功能区类型  */
    @ApiModelProperty(value = "项目空间功能区类型 ")
    @Column(name = "proj_room_func_type")
    @JSONField(name = "ProjRoomFuncType")
    var projRoomFuncType: String? =null

    /** 设计照明功率 */
    @ApiModelProperty(value = "设计照明功率")
    @Column(name = "rated_lightp")
    @JSONField(name = "RatedLightP")
    var ratedLightP: String? = null

    /** 内外区类型 */
    @ApiModelProperty(value = "内外区类型")
    @Column(name = "zone_type")
    @JSONField(name = "ZoneType")
    var zoneType: String? = null

    /** 租赁业态类型 */
    @ApiModelProperty(value = "租赁业态类型")
    @Column(name = "tenant_type")
    @JSONField(name = "TenantType")
    var tenantType: String? = null

    /** 所属租户 */
    @ApiModelProperty(value = "所属租户")
    @Column(name = "tenant")
    @JSONField(name = "Tenant")
    var tenant: String? = null

    /** 动态信息 */
    @ApiModelProperty(value = "动态信息")
    @Column(name = "dynamic_infor")
    @JSONField(name = "DynamicInfor")
    var dynamicInfor: java.util.HashMap<String, Any?>? = null

    /** 配电容量 */
    @ApiModelProperty(value = "配电容量")
    @Column(name = "elec_cap")
    @JSONField(name = "ElecCap")
    var elecCap: Double? =null

    /** 污染等级 */
    @ApiModelProperty(value = "污染等级")
    @Column(name = "pollution_degree")
    @JSONField(name = "PollutionDegree")
    var pollutionDegree: String? =null

    /** 租户信息 */
    @ApiModelProperty(value = "租户信息")
    @Column(name = "tenant_info")
    @JSONField(name = "TenantInfo")
    var tenantInfo: HashMap<String,Any?>? =null

    /** 环境参数 */
    @ApiModelProperty(value = "环境参数")
    @Column(name = "env_param")
    @JSONField(name = "EnvParam")
    var envParam: HashMap<String,Any?>? =null

    /** 人员信息 */
    @ApiModelProperty(value = "人员信息")
    @Column(name = "people_info")
    @JSONField(name = "PeopleInfo")
    var peopleInfo: HashMap<String,Any?>? =null

    /** 能耗信息 */
    @ApiModelProperty(value = "能耗信息")
    @Column(name = "consumption_info")
    @JSONField(name = "ConsumptionInfo")
    var consumptionInfo: HashMap<String,Any?>? =null

    /** 对象类型 */
    @ApiModelProperty(value = "对象类型")
    @Column(name = "object_type")
    @JSONField(name ="ObjectType")
     var objectType: String? = null

    /** 级联-设备 */
    @ApiModelProperty(value = "级联-设备")
    @SCascade(table="relationship.r_eq2sp", idColumn="sp_id", childIdColumn="eq_id",filter = "type = 'eq2sp_in'")
    @JSONField(name = "Equipment")
    var equipment: ArrayList<Equipment>? = null

    /** 级联-元空间 */
    @ApiModelProperty(value = "级联-元空间")
    @SCascade(table="relationship.r_sp2si", idColumn="sp_id", childIdColumn="si_id")
    @JSONField(name = "ZoneIspace")
    var zoneIspace: ArrayList<ZoneIspace>? = null

    /** 级联-系统 */
    @ApiModelProperty(value = "级联-系统")
    @SCascade(table="relationship.r_sy2sp", idColumn="sp_id", childIdColumn="sy_id",filter = "type = 'sy2sp'")
    @JSONField(name = "GeneralSystem")
    var generalSystem: ArrayList<GeneralSystem>? = null

    /** 级联-服务于空间的设备 */
    @ApiModelProperty(value = "级联-服务于空间的设备")
    @SCascade(table="relationship.r_eq2sp", idColumn="sp_id", childIdColumn="eq_id",filter = "type = 'eq2sp_for'")
    @JSONField(name = "EquipmentFor")
    var equipmentFor: ArrayList<Equipment>? = 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