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
import com.ys.bdtp.adm.mvvm.model.vo.Location

/**
 * 设备表
 *
 * @author bai
 *
 * @param id
 * @param name
 * @param objType 设备对象类型: equipment
 * @param classCode 设备类型
 * @param grouping
 * @param groupCode
 * @param projectId
 * @param localId
 * @param localName
 * @param infos
 * @param containerId
 * @param buildingId
 * @param floorId
 * @param bimId
 * @param createApp
 * @param updateApp
 * @param ts
 * @param valid
 * @param creator
 * @param creationTime
 * @param modifier
 * @param modifiedTime
 *
 */
@Entity(tableName = "equipment")
data class EquipmentEntity(
    @PrimaryKey @ColumnInfo(name = "id") val id: String,
    @ColumnInfo(name = "name") val name: String? = "",
    @ColumnInfo(name = "obj_type") val objType: String? = "",
    @ColumnInfo(name = "class_code") val classCode: String? = "",
    @ColumnInfo(name = "grouping") val grouping: Int = 1,
    @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 = "container_id") val containerId: String? = "",
    @ColumnInfo(name = "building_id") val buildingId: String?="",
    @ColumnInfo(name = "floor_id") val floorId: String?="",
    @ColumnInfo(name = "bim_id") val bimId: String? = "",
    @ColumnInfo(name = "create_app") val createApp: String? = "",
    @ColumnInfo(name = "update_app") val updateApp: String? = "",
    @ColumnInfo(name = "ts") val ts: Long = 0L,
    @ColumnInfo(name = "valid") val valid: Int = 1,
    @ColumnInfo(name = "creator") val creator: String? = "",
    @ColumnInfo(name = "creator_time") val creationTime: Long = 0L,
    @ColumnInfo(name = "modifier") val modifier: String? = "",
    @ColumnInfo(name = "modifier_time") val modifiedTime: Long = 0L
)

/**
 * 设备信息点
 */
data class EquipmentInfos(
    val brand: String,
    val codeType: String,
    val equipCheck: Int,
    val equipContent: String,
    val equipPhoto: String,
    val equipStatus: String,
    val location: Location,
    val modelId: String,
    val shapeType: String,
    val structureType: String,
    val installType: String,
    val manufacturer: String,
    val zRegion: String
)