package com.framework.mvvm.model.db.entity

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import kotlinx.serialization.Serializable

/**
 * 管道表
 */
@Entity(tableName = "pipe")
@Serializable
data class PipeEntity(
    @PrimaryKey val id: String,
    @ColumnInfo(name = "floor_id") val floorId: String?,              // 楼层id
    @ColumnInfo(name = "project_id") val projectId: String?,          // 项目id
    @ColumnInfo(name = "building_id") val buildingId: String?,        // 建筑id
    @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?,              // 管道方向(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: String?,                   // 管道路由(坐标列表格式:[{x:1,y:1,z:1}])
    @ColumnInfo(name = "infos") val infos: String?,                   // 管道的信息点
    @ColumnInfo(name = "creator") val creator: String?,               // 创建人
    @ColumnInfo(name = "creation_time") val creationTime: Long?,      // 创建时间
    @ColumnInfo(name = "modifier") val modifier: String?,             // 修改人
    @ColumnInfo(name = "modified_time") var modifiedTime: String?,      // 修改时间
    @ColumnInfo(name = "valid") var valid: Int?,                      // 合法标识
    @ColumnInfo(name = "upload_flag") val uploadFlag: String?,        // app端上传数据标记
    @ColumnInfo(name = "d2m_state") val d2mState: String?,            // 逆向数据的数模同步状态(0:未同步;1:已同步)
    @ColumnInfo(name = "delivery_state") val deliveryState: String?,  // 交付BDTP状态:1已交付,0待交付
    @ColumnInfo(name = "state") var state: String? = "0",               // 数据状态：0：未处理，1：已处理 2：已上传

    var objFromLocalId: String?,
    var objToLocalId: String?
)