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

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

import cn.sagacloud.server.datacenter.models.entities.base.BaseInfo
import com.alibaba.fastjson.annotation.JSONField
import com.sybotan.service.models.annotations.SCascade
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import javax.persistence.Column
import javax.persistence.Id
import javax.persistence.Table

/**
 * 楼层信息实体类
 *
 * @author  张维新
 */
@ApiModel(description = "楼层信息实体类")
@Table(name = "floor")
open class Floor : BaseInfo() {

    /** 楼层ID */
    @ApiModelProperty(value = "楼层ID")
    @Id
    @Column(name = "id")
    @JSONField(name = "FloorID")
    var id: String? = null

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

    /** 楼层本地编码 */
    @ApiModelProperty(value = "楼层本地编码")
    @Column(name = "local_id")
    @JSONField(name = "FloorLocalID")
    var localId: String? = null

    /** 楼层本地名称 */
    @ApiModelProperty(value = "楼层本地名称")
    @Column(name = "local_name")
    @JSONField(name = "FloorLocalName")
    var localName: String? = null

    /** 樓層二維碼圖片 */
    @ApiModelProperty(value = "樓層二維碼圖片")
    @Column(name = "qr_code")
    @JSONField(name = "FloorQRCode")
    var qr_code: 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 = "BuildID")
    var buildId: String? = null

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

    /** BIM模型中编码 */
    @ApiModelProperty(value = "BIM模型中编码")
    @Column(name = "bim_id_pre")
    @JSONField(name = "BIMIDPre")
    var bimIdPre: String? = null

    /** 楼层顺序码 */
    @ApiModelProperty(value = "楼层顺序码")
    @Column(name = "sequence_id")
    @JSONField(name = "FloorSequenceID")
    var sequenceId: Int? = null

    /** 结构信息 */
    @ApiModelProperty(value = "结构信息")
    @Column(name = "structure_info")
    @JSONField(name = "StructureInfo")
    var structureInfo: HashMap<String,Any?>? = null

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

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

//    @ApiModelProperty(value = "楼板标高")
//    @Column(name = "floor_elevation")
//    @JSONField(name = "FloorElevation")
//    var floorElevation: Double? = null

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

    /** 工作历信息 */
    @ApiModelProperty(value = "工作历信息")
    @Column(name = "work_calendar")
    @JSONField(name = "WorkCalendar")
    var workCalendar: HashMap<String,Any?>? = null

    /** 建筑   table  对应关系表   idColumn 对应 本类的关系id    childIdColumn 级联对象的关系id */
    @ApiModelProperty(value = "级联-楼层")
    @SCascade(table="floor", idColumn="id", childIdColumn="building_id")
    @JSONField(name = "Building")
    var building: Building? = null

    /** 项目 */
    @ApiModelProperty(value = "级联-项目")
    @SCascade(table="floor", idColumn="id", childIdColumn="project_id")
    @JSONField(name = "Project")
    var project: Project? = null

    /** 贯通关系   self = true  同样的对象查询时 id可以互相调换查询   */
    @ApiModelProperty(value = "级联-贯通关系")
    @SCascade(table="r_fl_through_fl", idColumn="floor_id", childIdColumn="floor_other_id", self = true)
    @JSONField(name = "FloorThroughList")
    var floorThroughList: ArrayList<Floor>? = null

//    /** 项目 */
//    @ApiModelProperty(value = "级联-项目")
//    @SCascade(table="floor", idColumn="id", childIdColumn="project_id")
//    @JSONField(name = "Equipment")
//    var Equipment: ArrayList<Equipment>? = null

    /** 模型文件id */
    @ApiModelProperty(value = "模型文件id")
    @Column(name = "model_id")
    @JSONField(name = "ModelId")
    var modelId: String? = null

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

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

    /** 自定义信息点 */
    @ApiModelProperty(value = "自定义信息点")
    @Column(name = "properties")
    @JSONField(name = "Properties")
    var properties: HashMap<String,Any?>? = null


} // Class Floor