package com.crunii.micro.domain.entity.main;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "YCQ_COCKPIT_MODEL")
@DynamicInsert
@DynamicUpdate
@ToString
@Data
public class YcqCockpitModel {

    @ExcelProperty(value = {"id"}, index = 0)
    private Long id;
    @ExcelProperty(value = {"code"}, index = 1)
    private String code;
    @ExcelProperty(value = {"name"}, index = 2)
    private String name;
    @ExcelProperty(value = {"remark"}, index = 3)
    private String remark;
    @ExcelProperty(value = {"createTime"}, index = 4)
    private Date createTime;
    @ExcelProperty(value = {"createUser"}, index = 5)
    private String createUser;
    @ExcelProperty(value = {"type"}, index = 6)
    private Integer type;
    @ExcelProperty(value = {"state"}, index = 7)
    private Integer state;
    @ExcelProperty(value = {"status"}, index = 8)
    private Integer status;
    @ExcelProperty(value = {"systemId"}, index = 9)
    private Long systemId;
    /**
     * 是否同步正式环境：0否,1是
     */
    @ExcelProperty(value = {"syncProdEnv"}, index = 10)
    private Integer syncProdEnv;

    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "NAME")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "REMARK")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "CREATE_USER")
    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Basic
    @Column(name = "TYPE")
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Basic
    @Column(name = "STATE")
    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @Basic
    @Column(name = "STATUS")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "SYSTEM_ID")
    public Long getSystemId() {
        return systemId;
    }

    public void setSystemId(Long systemId) {
        this.systemId = systemId;
    }

    @Basic
    @Column(name = "sync_prod_env")
    public Integer getSyncProdEnv() {
        return syncProdEnv;
    }

    public void setSyncProdEnv(Integer syncProdEnv) {
        this.syncProdEnv = syncProdEnv;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        YcqCockpitModel floModel = (YcqCockpitModel) o;
        return Objects.equals(id, floModel.id) &&
                Objects.equals(name, floModel.name) &&
                Objects.equals(remark, floModel.remark) &&
                Objects.equals(createTime, floModel.createTime) &&
                Objects.equals(createUser, floModel.createUser) &&
                Objects.equals(status, floModel.status) &&
                Objects.equals(syncProdEnv, floModel.syncProdEnv);
    }



    @Override
    public int hashCode() {
        return Objects.hash(id, name, remark, createTime, createUser, status, syncProdEnv);
    }
}
