package cn.estsh.i3plus.pojo.mes.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_DATA_MIGRATION_CFG")
@Api("MES数据迁移配置表")
public class MesDataMigrationCfg extends BaseBean implements Serializable {

    private static final long serialVersionUID = -6445732389643648643L;

    @Column(name = "PCN_CODE")
    @ApiParam("PCN节点名称代码")
    private String pcnCode;

    @Column(name = "MIG_NAME")
    @ApiParam("名称")
    private String migName;

    @Column(name = "REMARK")
    @ApiParam("描述")
    private String remark;

    @Column(name = "SRC_TABLE_NAME")
    @ApiParam("来源表名")
    private String srcTableName;

    @Column(name = "SRC_QUERY_CONDITIONS")
    @ApiParam("来源表查询条件")
    private String srcQueryConditions;

    @Column(name = "PROCESS_QTY")
    @ApiParam(value = "每次处理行数", example = "0")
    private Integer processQty;

    @Column(name = "DEST_TABLE_NAME")
    @ApiParam("目标表名")
    private String destTableName;

    @Column(name = "IS_PHYSICAL_DELETE")
    @ApiParam(value = "是否物理删除", example = "0")
    private Integer isPhysicalDelete;

    //枚举：CommonEnumUtil.DATA_SOURCE_TYPE
    @Column(name = "DATASOURCE_TYPE")
    @ApiParam(value = "数据源类型")
    private String dataSourceType;

    @Column(name = "LAST_EXECUTION_TIME")
    @ApiParam("末次迁移时间")
    private String lastExecutionTime;

    @Column(name = "LAST_MIGRATION_QTY")
    @ApiParam(value = "末次迁移记录数", example = "0")
    private Integer lastMigrationQty;


    @Transient
    @ApiParam(value = "开始时间")
    private String mcStartTime;

    @Transient
    @ApiParam(value = "结束时间")
    private String mcEndTime;

}
