package com.framework.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 = "pipe")
data class PipeEntity(
    @PrimaryKey @ColumnInfo(name = "id") override val id: String,
    @ColumnInfo(name = "floor_id") override val floorId: String? = "",
    @ColumnInfo(name = "project_id") override val projectId: String? = "",
    @ColumnInfo(name = "building_id") override val buildingId: String? = "",
    @ColumnInfo(name = "valid") override var valid: Int = 1,
    @ColumnInfo(name = "state") override var state: Int = -1,
    @ColumnInfo(name = "ts") override val ts: Long = 0L,
    @ColumnInfo(name = "obj_from") val objFrom: String? = "",                // 管道的from端对象
    @ColumnInfo(name = "type_from") val typeFrom: String? = "",              // from端对象类型(equipment:设备;pipe:管道)
    @ColumnInfo(name = "obj_to") val objTo: String? = "",                    // 管道的to端对象
    @ColumnInfo(name = "type_to") val typeTo: String? = "",                  // to端对象类型(equipment:设备;pipe:管道)
    @ColumnInfo(name = "direction") val direction: Int? = null,              // 管道方向(1:正向from->to;-1:反向to->from;0:无方向
    @ColumnInfo(name = "pipe_type") val pipeType: String? = "",              // 管道的数据字典类型(OTLAPL: 液体管道|OTAAPL: 气体管道)'
    @ColumnInfo(name = "pipe_sub_type") val pipeSubType: String? = "",       // 管道用途
    @ColumnInfo(name = "route") val route: JsonElement? = null,              // 管道路由(坐标列表格式:[{x:1,y:1,z:1}])
    @ColumnInfo(name = "infos") val infos: JsonElement? = null,              // 管道的信息点
    @ColumnInfo(name = "d2m_state") val d2mState: String? = null,            // 逆向数据的数模同步状态(0:未同步;1:已同步)
    @ColumnInfo(name = "delivery_state") val deliveryState: String? = null,  // 交付BDTP状态:1已交付,0待交付
    var objFromLocalId: String? = "",
    var objToLocalId: String? = "",
) : BaseEntity