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

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.ys.bdtp.adm.mvvm.model.db.entity.BaseEntity
import com.google.gson.JsonElement

/**
 * 对象表
 * 建筑，楼层，空间，设备
 */

@Entity(tableName = "object")
data class ObjectEntity(
    @PrimaryKey @ColumnInfo(name = "id") override val id: String,
    @ColumnInfo(name = "project_id") override val projectId: String?,
    @ColumnInfo(name = "building_id") override val buildingId: String?,
    @ColumnInfo(name = "floor_id") override val floorId: String?,
    @ColumnInfo(name = "state") override var state: Int = -1,
    @ColumnInfo(name = "valid") override var valid: Int = 1,
    @ColumnInfo(name = "ts") override val ts: Long = 0L,
    @ColumnInfo(name = "name") val name: String? = "",
    @ColumnInfo(name = "obj_type") val objType: String? = "",                   // 对象类型
    @ColumnInfo(name = "class_code") var classCode: String? = "",               // 对象类型编码
    @ColumnInfo(name = "local_id") var localId: String? = "",                   // 对象位置编码
    @ColumnInfo(name = "local_name") var localName: String? = "",               // 对象位置名称
    @ColumnInfo(name = "group_code") val groupCode: String? = "",               // 集团编码
    @ColumnInfo(name = "grouping") val grouping: Int = 1,                       // 1 表示单个对象，2 表示对象组
    @ColumnInfo(name = "client_device") val clientDevice: String? = "",         // 标识客户端设备
    @ColumnInfo(name = "client_id") val clientId: String? = "",                 // 客户端生成id
    @ColumnInfo(name = "delivery_state") val deliveryState: Int? = null,        // BDTP交付状态: 1 已交付, 0 待交付
    @ColumnInfo(name = "d2m_state") val d2mState: Int? = null,                  // 逆向数据的数模同步状态(0:未同步;1:已同步)
    @ColumnInfo(name = "virtual_codes") val virtualCodes: JsonElement? = null,  // 虚点清单: Json 数据格式
    @ColumnInfo(name = "infos") var infos: JsonElement? = null,                 // 信息点数据: Json 数据格式
    @ColumnInfo(name = "floor_map") var floorMap: String? = "",                 // 楼层地图
    @ColumnInfo(name = "container_id") var containerId: String? = "",           // 无模型设备的上级设备id
    @ColumnInfo(name = "bim_id") var bimId: String? = ""                        // 无模型设备的上级设备id
) : BaseEntity

/*

data class Infos(
    val bimId: String,
    val bimLocation: String,
    val codeType: Int,
    val height: Int,
    val modelId: String,
//    val outline: List<List<List<Outline>>>,
    val schemeId: String,
    val state: String,
    val RoomLocalName: String,
    var unit: String,
    val group: String,
    val label: String,
    var options: ArrayList<Options>,
    var dataType: String,
    var inputType: String,
    val code: String,
    val floorMap: String
)

data class Options(val name: String, val code: String)

data class InfosForObj(
    val floorMap: String,
    val state: String,
    val height: Int,
    val outline: ArrayList<ArrayList<ArrayList<PointZ>>>
)

data class InfosforBuild(
    val floorMap: String,
    val state: String,
    val height: Int,
    val floorSequenceID: Int,
)

data class InfosforFloor(
    val digitalDeliveryID: String,
    val bimIdPre: String,
    val floorElevation: Double,
)

data class InfosforSpace(
    val digitalDeliveryID: String,
)

data class InfosforEq(
    val location: Pointz2,
    var zRegion: String,
    var equipCheck: Any,
    var digitalDeliveryID: String,
)
*/
