package com.ys.bdtp.adm.mvvm.model.db.entity.dict

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.google.gson.JsonElement

/**
 * 字典, 关系表
 *
 * @author bai
 *
 * @param id
 * @param relCode 关系编码
 * @param name 关系名称
 * @param graphCode 图编码
 * @param directional 方向
 * @param attribute 属性
 * @param fromObjType 指出
 * @param toObjType 指向
 * @param remark 备注 * @param valid 有效标识: 0 无效, 1 有效
 *
 */
@Entity(tableName = "relation_dict")
data class RelationDictEntity(
    @PrimaryKey val id: String,
    @ColumnInfo(name = "rel_code") val relCode: String,
    @ColumnInfo(name = "graph_code") val graphCode: String,
    @ColumnInfo(name = "graph_name") val graphName: String,
    @ColumnInfo(name = "group_code") val groupCode: String,
    @ColumnInfo(name = "attribute") val attribute: String?,
    @ColumnInfo(name = "automatic_flag") val automaticFlag: String?,
    @ColumnInfo(name = "cal_flag") val calFlag: Boolean,
    @ColumnInfo(name = "delivery_cal_flag") val deliveryCalFlag: Boolean,
    @ColumnInfo(name = "delivery_type") val deliveryType: Int,
    @ColumnInfo(name = "directional") val directional: Int?,
    @ColumnInfo(name = "from_obj_type") val fromObjType: String?,
    @ColumnInfo(name = "to_obj_type") val toObjType: String?,
    @ColumnInfo(name = "target_objs") val targetObjs: String?,
    @ColumnInfo(name = "manual") val manual: Int = 0,
    @ColumnInfo(name = "project_id") val projectId: String,
    @ColumnInfo(name = "prompting") val prompting: String? = "",
    @ColumnInfo(name = "source_flag") val sourceFlag: Boolean,
    @ColumnInfo(name = "system_type") val systemType: Int = 0,
    @ColumnInfo(name = "before_cal_rels") val beforeCalRels: JsonElement? = null,
    @ColumnInfo(name = "cal_rules") val calRules: JsonElement? = null,
    @ColumnInfo(name = "source_type_codes") val sourceTypeCodes: JsonElement? = null,
    @ColumnInfo(name = "end_type_codes") val endTypeCodes: JsonElement? = null,
    @ColumnInfo(name = "zone_types") val zoneTypes: JsonElement? = null,
    @ColumnInfo(name = "mep_system_type") val mepSystemType: JsonElement? = null,
    @ColumnInfo(name = "valid") var valid: Int?,                   // 有效标识, // 1 正常 0 删除
    @ColumnInfo(name = "remark") val remark: String?,
    @ColumnInfo(name = "creator") val creator: String,
    @ColumnInfo(name = "creation_time") val creationTime: Long,

    )