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 objType 建筑类型: building
 * @param classCode 建筑类型编码,
 * @param grouping 是否对象组: 1 单个对象 2 对象组
 * @param groupCode 集团编码
 * @param projectId 项目id
 * @param localId 建筑位置id
 * @param localName 建筑位置名称
 * @param infos 建筑附加信息: Gson解析后对应 BuildingInfos 对象
 * @param valid 有效标识: 1 有效 2 失效
 * @param modifier 修改者
 * @param modifiedTime 修改时间
 * @param creator 创建者
 * @param creationTime 创建时间
 *
 */
@Entity(tableName = "building")
data class BuildingEntity(
    @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 = "valid") val valid: Int,
    @ColumnInfo(name = "modifier") val modifier: String,
    @ColumnInfo(name = "modifier_time") val modifiedTime: Long,
    @ColumnInfo(name = "creator") val creator: String,
    @ColumnInfo(name = "creator_time") val creationTime: Long,
)

/**
 * 建筑信息点
 */
data class BuildingInfos(
    val buildFuncType: String,
    val coolType: List<String>,
    val coverArea: String,
    val fireResistanceLev: String,
    val floorArea: String,
    val floorLayer: String,
    val gFA: String,
    val greenBuildLev: String,
    val majorFormat: String,
    val pic: List<Pic>,
    val sFI: String,
    val structType: String,
    val totHeight: String,
    val totLayer: String,
    val underArea: String,
    val underLayer: String,
)

data class Pic(
    val createTime: String,
    val key: String,
    val name: String,
    val systemId: String,
    val type: String,
)