package com.persagy.labsl.domain

import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableName
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
import com.github.jeffreyning.mybatisplus.anno.MppMultiId
import com.persagy.labsl.models.entities.tpt.ElementsEntity
import lombok.Data
import java.io.Serializable
import java.util.*

/**
 *
 * @TableName graph
 */
@TableName(value = "graph",autoResultMap = true)
@Data
open class GraphEntity : Serializable {
    /**
     * 对象id
     */
    @MppMultiId
    @TableField(value = "id")
    var id: String? = null
    /**
     * 系统图id
     */
    @MppMultiId
    @TableField(value = "graph_id")
    var graphId: String? = null
    /**
     * 图名称
     */
    @TableField(value = "name")
    var name: String? = null
    /**
     * 图分类id
     */
    @TableField(value = "category_id")
    var categoryId: String? = null
    /**
     * 项目id
     */
    @TableField(value = "project_id")
    var projectId: String? = null
    /**
     * 建筑id
     */
    @TableField(value = "building_id")
    var buildingId: String? = null
    /**
     * 楼层id
     */
    @TableField(value = "floor_id")
    var floorId: String? = null
    /**
     * 说明
     */
    @TableField(value = "note")
    var note: String? = null
    /**
     * 版本号
     */
    @TableField(value = "version")
    var version: String? = null
    /**
     * 移至回收站时间
     */
    @TableField(value = "del_time")
    var delTime: Date? = null
    /**
     * 是否移至回收站 , false 正常，true 以至回收站
     */
    @TableField(value = "is_available")
    var isAvailable: Int? = null
    /**
     * 内部版本号
     */
    @TableField(value = "tag_version")
    var tagVersion: Int? = null
    /**
     * 图片Key
     */
    @TableField(value = "pic")
    var pic: String? = null
    /**
     * 图状态（1一般，2待审核，3审核完成，4回收站 ,0发布）
     */
    @TableField(value = "state")
    var state: Int? = null
    /**
     * 页面尺寸
     */
    @TableField(value = "page_size",typeHandler = JacksonTypeHandler::class)
    var pageSize: Any? = null
    /**
     * 标签
     */
    @TableField(value = "label",typeHandler = JacksonTypeHandler::class)
    var label: Any? = null
    /**
     * 更新时间
     */
    @TableField(value = "last_update")
    var lastUpdate: Date? = null
    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    var createTime: Date? = null
    /**
     * 背景色
     */
    @TableField(value = "view_background")
    var viewBackground: String? = null

    @TableField(exist = false)
    open var elements: ElementsEntity? = null

    companion object {
        //fun toEntityByObj(graph: Graph): GraphEntity? {
        //  val graphEntity = GraphEntity()
        //  graphEntity.id=graph.id
        //}
        @TableField(exist = false)
        private val serialVersionUID = 1L
    }
}