package com.ys.bdtp.adm.mvvm.model.db.entity.task

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.google.gson.JsonElement

/**
 * 楼层表
 *
 * @author bai
 *
 * @param id
 * @param name 楼层名
 * @param buildingId 所属建筑id
 * @param objType 楼层类型: floor
 * @param classCode 楼层类型编码
 * @param grouping 是否对象组: 1 单个对象 2 对象组
 * @param groupCode 集团编码
 * @param projectId 项目id
 * @param localId 建筑位置id
 * @param localName 建筑位置名称
 * @param infos 楼层附加信息: Gson解析后对应 FloorInfos
 * @param valid 有效标识: 1 有效 2 失效
 * @param modifier 修改者
 * @param modifiedTime 修改时间
 * @param creator 创建者
 * @param creationTime 创建时间
 *
 */
@Entity(tableName = "floor")
data class FloorEntity(
    @PrimaryKey @ColumnInfo(name = "id") val id: String,
    @ColumnInfo(name = "name") val name: String,
    @ColumnInfo(name = "building_id") val buildingId: String,
    @ColumnInfo(name = "obj_type") val objType: String,
    @ColumnInfo(name = "class_code") val classCode: String,
    @ColumnInfo(name = "grouping") val grouping: Int,
    @ColumnInfo(name = "group_code") val groupCode: String,
    @ColumnInfo(name = "project_id") val projectId: String,
    @ColumnInfo(name = "local_id") val localId: String,
    @ColumnInfo(name = "local_name") val localName: String,
    @ColumnInfo(name = "infos") val infos: JsonElement? = null,
    @ColumnInfo(name = "valid") val valid: Int,
    @ColumnInfo(name = "creator") val creator: String,
    @ColumnInfo(name = "creator_time") val creationTime: Long,
    @ColumnInfo(name = "modifier") val modifier: String,
    @ColumnInfo(name = "modifier_time") val modifiedTime: Long
)

/**
 * 楼层信息点
 */
data class FloorInfos(
    val bimIdPre: String,
    val floorElevation: Double,
    val floorLocateType: String,
    val floorMap: String,
    val floorSequenceID: Int,
    val floorType: String,
    val height: Double,
    val modelId: String
)