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

package cn.sagacloud.server.datacenter.models.entities.graphtype.rel.electricity

import cn.sagacloud.server.datacenter.models.entities.base.BaseInfo
import cn.sagacloud.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
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 = "equipment")
open class RelEquipmentLubOrdinary : BaseInfo() {


    /** 设备id */
    @ApiModelProperty(value = "设备id",required = true)
    @Id
    @Column(name = "id")
    @JSONField(name = "Id")
//    @JsonProperty("EquipID")
    var id: String? = null

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

    /** 设备本地编码 */
    @ApiModelProperty(value = "设备本地编码")
    @Column(name = "local_id")
    @JSONField(name = "LocalID")
    var localId: String? = null

    /** 设备本地名称 */
    @ApiModelProperty(value = "设备本地名称")
    @Column(name = "local_name")
    @JSONField(name = "LocalName")
    var localName: String? = null



    /** 设计图纸中编码 */
    @ApiModelProperty(value = "设计图纸中编码")
    @Column(name = "cad_id")
    @JSONField(name = "CADID")
    var cadId: String? = null

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

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

    /** 设备类型code */
    @ApiModelProperty(value = "设备类型code")
    @Column(name = "category")
    @JSONField(name = "Category")
    var category: 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

//    //    /** 设备关联的资产id */
//    @ApiModelProperty(value = "设备关联的资产id")
//    @Column(name = "property_id",insertable = false,updatable = false )
//    @JSONField(name = "PropertyId")
//    var propertyId: String? = null

    /** Revit族 */
    @ApiModelProperty(value = "Revit族 ")
    @Column(name = "family_name")
    @JSONField(name = "BIMFamilyName")
    var familyName: String? = null

    /** Revit族类型 */
    @ApiModelProperty(value = "Revit族类型 ")
    @Column(name = "family_symbol")
    @JSONField(name = "BIMFamilySymbol")
    var familySymbol: String? = null

    /** 级联-设备 */
    @ApiModelProperty(value = "级联-设备")
    @SCascade(table="r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_LUDistribution_1'")
    @JSONField(name = "ObjectInfo")
    var objectInfo: ArrayList<RelEquipmentFloor>? = null

} // Class Equipment









