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

import cn.sagacloud.server.datacenter.models.entities.base.RBaseInfo
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.Id
import javax.persistence.Table

/**
 * 现场任务方案
 *
 * @author 张维新
 */
@ApiModel(description = "现场任务方案实体类")
@Table(name = "scantask.scan_scheme")
class ScanScheme : RBaseInfo() {

    /** 方案id */
    @ApiModelProperty(value = "方案id")
    @Id
    @Column(name = "id")
    @JSONField(name = "SchemeId")
    var id: String? = null

    /** 方案名称 */
    @ApiModelProperty(value = "方案名称")
    @Column(name = "name")
    @JSONField(name = "SchemeName")
    var name: String? = null

    @ApiModelProperty(value = "方案名称")
    @Column(name = "code")
    @JSONField(name = "Code")
    var code: String? = null

    /** 级联-项目   table  对应关系表   idColumn 对应 本类的id    childIdColumn 级联对象的关系id */
    @ApiModelProperty(value = "级联-信息点")
    @SCascade(table="scantask.scan_scheme_info", idColumn="scheme_id", childIdColumn="id")
    @JSONField(name = "ScanSchemeInfo")
    var scanSchemeInfoList: ArrayList<ScanSchemeInfo>? = null

} // class ScanScheme