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

/**
 * 文件表
 *
 * @author bai
 *
 * @param id
 * @param projectId
 * @param buildingId
 * @param floorId
 * @param fileId 文件服务中存储的id
 * @param filePath 文件存储路径
 * @param fileType 文件类型(photo|video|file|...)
 * @param bizType 业务类型(object:对象附件|problem_arch:空间问题附件|problem_equip:设备问题附件)
 * @param clientPath app端文件存储路径
 * @param refObjId 关联的对象id
 * @param refInfoCode 关联的对象信息点code
 * @param remark 描述
 * @param orderNum 文件附件(照片)的排序序号
 * @param state
 * @param ts
 * @param valid
 * @param creator
 * @param creationTime
 * @param modifier
 * @param modifiedTime
 *
 */
@Entity(tableName = "file")
data class FileEntity(
    @PrimaryKey @ColumnInfo(name = "id") val id: String,
    @ColumnInfo(name = "project_id") val projectId: String,
    @ColumnInfo(name = "building_id") val buildingId: String,
    @ColumnInfo(name = "floor_id") val floorId: String,
    @ColumnInfo(name = "file_id") val fileId: String? = "",
    @ColumnInfo(name = "file_path") val filePath: String? = "",
    @ColumnInfo(name = "file_type") val fileType: String? = "",
    @ColumnInfo(name = "biz_type") val bizType: String? = "",
    @ColumnInfo(name = "client_path") val clientPath: String? = "",
    @ColumnInfo(name = "ref_obj_id") val refObjId: String? = "",
    @ColumnInfo(name = "ref_info_code") val refInfoCode: String? = "",
    @ColumnInfo(name = "remark") val remark: String? = "",
    @ColumnInfo(name = "order_num") val orderNum: Int? = -1,
    @ColumnInfo(name = "state") var state: Int = -1,
    @ColumnInfo(name = "ts") val ts: Long = 0L,
    @ColumnInfo(name = "valid") var valid: Int = 1,
    @ColumnInfo(name = "creator") val creator: String? = null,
    @ColumnInfo(name = "creation_time") val creationTime: String? = null,
    @ColumnInfo(name = "modifier") val modifier: String? = null,
    @ColumnInfo(name = "modified_time") val modifiedTime: String? = null
)