package com.persagy.server.datacenter.models.entities.task

import com.alibaba.fastjson.annotation.JSONField
import com.persagy.server.datacenter.models.entities.dict.EquipFamilyCategory
import com.persagy.server.datacenter.models.entities.objects.Building
import com.persagy.server.datacenter.models.entities.objects.Floor
import com.persagy.server.datacenter.models.entities.objects.Project
import com.persagy.server.datacenter.models.entities.task.base.ScanTaskBase
import com.persagy.service.models.annotations.SCascade
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import javax.persistence.Table

/**
 * 资产台账任务
 *
 * @author  邓婷婷
 */
@ApiModel(description = "资产台账任务实体类")
@Table(name = "scantask.property_scan_task")
open class PropertyScanTask : ScanTaskBase() {

//    val CODE_TYPE_SIMA_DEL= -5 //已撕码
//    val CODE_TYPE_NONE = -1//未贴码
//    val CODE_TYPE_FAR = -2//太远
//    val CODE_TYPE_HIDEN = -3//隐藏工程
//    val CODE_TYPE_NOTFOUND = -4//未找到
//    val CODE_TYPE_NORMAL = 0//正常贴码
//    val CODE_TYPE_TIEMA = 1//贴码
//    val CODE_TYPE_HUANMA = 2//换码任务
//    val CODE_TYPE_SIMA = 3//撕码


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

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

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

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

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

    /** 级联-资产设备族 */
    @ApiModelProperty(value = "级联-资产设备族")
    @SCascade(table="scantask.property_scan_task", idColumn="id", childIdColumn="category")
    @JSONField(name = "EquipFamily")
    var equipFamily: EquipFamilyCategory? = null

} // Class PropertyScanTask