package cn.sagacloud.server.datacenter.models.entities.task

import cn.sagacloud.server.datacenter.models.entities.*
import com.alibaba.fastjson.annotation.JSONField
import com.sybotan.service.models.annotations.SCascade
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import javax.persistence.Column
import javax.persistence.Table

/**
 * 设备台账任务
 *
 * @author  邓婷婷
 */
@ApiModel(description = "设备台账任务实体类")
@Table(name = "scantask.equip_scan_task")
class EquipScanTask : ScanTaskBase()  {

    /** 父类id */
    @ApiModelProperty(value = "父类id")
    @Column(name = "parent_id")
//    @Id
    @JSONField(name = "ParentId")
    var parentId: String? = null


    @ApiModelProperty(value = "部件指向父类设备任务id")
    @Column(name = "task_parent_id")
    @JSONField(name = "TaskParentId")
    var taskParentId: String? = null


    /** 级联-项目   table  对应关系表   idColumn 对应 本类的id    childIdColumn 级联对象的关系id */
    @ApiModelProperty(value = "级联-项目")
    @SCascade(table="scantask.equip_scan_task", idColumn="id", childIdColumn="project_id")
    @JSONField(name = "Project")
    var project: Project? = null

    /** 级联-建筑 */
    @ApiModelProperty(value = "级联-建筑")
    @SCascade(table="scantask.equip_scan_task", idColumn="id", childIdColumn="building_id")
    @JSONField(name = "Building")
    var building: Building? = null

    /** 级联-楼层 */
    @ApiModelProperty(value = "级联-楼层")
    @SCascade(table="scantask.equip_scan_task", idColumn="id", childIdColumn="floor_id")
    @JSONField(name = "Floor")
    var floor: Floor? = null

    /** 级联-方案*/
    @ApiModelProperty(value = "级联-方案")
    @SCascade(table="scantask.equip_scan_task", idColumn="id", childIdColumn="scheme_id")
    @JSONField(name = "ScanScheme")
    var scanScheme: ScanScheme? = null

//    /** 级联-部件*/
//    @ApiModelProperty(value = "级联-部件")
//    @SCascade(table="scantask.equip_scan_task", idColumn="id", childIdColumn="equip_id")
//    @JSONField(name = "Equipment")
//    var equipment: Equipment? = null

    /** 级联-部件   table  对应关系表   idColumn 对应 本类的id    childIdColumn 级联对象的关系id */
    @ApiModelProperty(value = "级联-部件")
    @SCascade(table="scantask.equip_scan_task", idColumn="parent_id", childIdColumn="equip_id")
    @JSONField(name = "Component")
    var component: ArrayList<EquipScanTask>? = null

    /** 级联-设备分类 */
    @ApiModelProperty(value = "级联-设备分类")
    @SCascade(table="scantask.equip_scan_task", idColumn="id", childIdColumn="category")
    @JSONField(name = "EquipCategory")
    var equipCategory: EquipCategory? = null

    /** 级联-设备族 */
    @ApiModelProperty(value = "级联-设备族")
    @SCascade(table="scantask.equip_scan_task", idColumn="id", childIdColumn="category")
    @JSONField(name = "Family")
    var family: EquipFamily? = null


} // Class EquipScanTask