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

/**
 * 关系(业务)表
 */
@Entity(tableName = "relation")
data class RelationEntity(
    @PrimaryKey @ColumnInfo(name = "id") override val id: String,
    @ColumnInfo(name = "project_id") override val projectId: String? = null,
    @ColumnInfo(name = "building_id") override val buildingId: String? = null,
    @ColumnInfo(name = "floor_id") override val floorId: String? = null,
    @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 = "group_code") val groupCode: String? = null,         // 集团代码
    @ColumnInfo(name = "graph_id") val graphId: String? = null,             // 图id
    @ColumnInfo(name = "graph_code") val graphCode: String? = null,         // 图编码
    @ColumnInfo(name = "rel_code") val relCode: String? = null,             // 关系编码
    @ColumnInfo(name = "rel_value") val relValue: String? = null,           // 关系值
    @ColumnInfo(name = "obj_from") val objFrom: String? = null,             // 关系源对象
    @ColumnInfo(name = "obj_to") val objTo: String? = null,                 // 关系目标对象
    @ColumnInfo(name = "client_id") val clientId: String? = null,           // 客户端生成id
    @ColumnInfo(name = "client_device") val clientDevice: String? = null,   // 标识客户端设备
    @ColumnInfo(name = "delivery_state") val deliveryState: Int = -1,       // BDTP交付状态: 1 已交付, 0 待交付
    @ColumnInfo(name = "d2m_state") val d2mState: Int = -1,                 // 逆向数据的数模同步状态(0:未同步;1:已同步)
    var objFromLocalId: String? = null,
    var objToLocalId: String? = null,
) : BaseEntity
