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

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

import com.persagy.server.datacenter.models.entities.assistant.PointPosition
import com.persagy.server.datacenter.models.entities.base.BaseInfo
import com.persagy.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")
    var id: String? = null

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

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

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

    /** 二维码内容 */
    @ApiModelProperty(value = "二维码内容")
    @Column(name = "default_or_code")
    var defaultQRCode: String? = null

    /** 二维码图片 */
    @ApiModelProperty(value = "二维码图片")
    @Column(name = "qr_code_pic")
    var qRCodePic: String? = null

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

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

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

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

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

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

    /** 楼层常驻人数 */
    @ApiModelProperty(value = "楼层常驻人数")
    @Column(name = "permanent_people_num")
    var permanentPeopleNum: Int? = null

    /** 楼层编码 */
    @ApiModelProperty(value = "楼层编码")
    @Column(name = "floor_identity")
    var floorIdentity: String? = null

    /** 信息点 */
    @ApiModelProperty(value = "信息点")
    @Column(name = "infos")
    var infos: HashMap<String,Any?>? = null

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

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

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

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

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

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

    /** 贯通关系   self = true  同样的对象查询时 id可以互相调换查询   */
    @ApiModelProperty(value = "级联-贯通关系")
    @SCascade(table="r_fl_through_fl", idColumn="floor_id", childIdColumn="floor_other_id", self = true)
    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")
    var modelId: String? = null

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

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



} // Class Floor