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

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

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



@Entity
@Table(name = "YCQ_COCKPIT_MODEL_COLUMN")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = {"id"})
@GenericGenerator(name = "idGenerator", strategy = "com.crunii.micro.core.distributed.DistributedSnowFlakeId")
public class YcqCockpitModelColum {
    @ExcelProperty(value = {"id"}, index = 0)
    private Long id;
    @ExcelProperty(value = {"modelId"}, index = 1)
    private Long modelId;
    @ExcelProperty(value = {"name"}, index = 2)
    private String name;
    @ExcelProperty(value = {"type"}, index = 3)
    private String type;
    @ExcelProperty(value = {"intSize"}, index = 4)
    private Integer intSize;
    @ExcelProperty(value = {"decSize"}, index = 5)
    private Integer decSize;
    @ExcelProperty(value = {"isDesensitization"}, index = 6)
    private boolean isDesensitization;
    @ExcelProperty(value = {"defaultVal"}, index = 7)
    private String defaultVal;
    @ExcelProperty(value = {"remark"}, index = 8)
    private String remark;
    @ExcelProperty(value = {"createTime"}, index = 9)
    private Date createTime;
    @ExcelProperty(value = {"createUser"}, index = 10)
    private String createUser;
    @ExcelProperty(value = {"status"}, index = 11)
    private Integer status;
    @ExcelProperty(value = {"isNeed"}, index = 12)
    private boolean isNeed;
    @ExcelProperty(value = {"isShowColumn"}, index = 13)
    private Integer isShowColumn;




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

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

    @Basic
    @Column(name = "MODEL_ID")
    public Long getModelId() {
        return modelId;
    }

    public void setModelId(Long modelId) {
        this.modelId = modelId;
    }

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

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

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

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

    @Basic
    @Column(name = "INT_SIZE")
    public Integer getIntSize() {
        return intSize;
    }

    public void setIntSize(Integer intSize) {
        this.intSize = intSize;
    }

    @Basic
    @Column(name = "DEC_SIZE")
    public Integer getDecSize() {
        return decSize;
    }

    public void setDecSize(Integer decSize) {
        this.decSize = decSize;
    }

    @Basic
    @Column(name = "IS_DESENSITIZATION")
    public boolean isDesensitization() {
        return isDesensitization;
    }

    public void setDesensitization(boolean desensitization) {
        isDesensitization = desensitization;
    }

    @Basic
    @Column(name = "DEFAULT_VAL")
    public String getDefaultVal() {
        return defaultVal;
    }

    public void setDefaultVal(String defaultVal) {
        this.defaultVal = defaultVal;
    }

    @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 = "STATUS")
    public Integer getStatus() {
        return status;
    }

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



    @Basic
    @Column(name = "IS_NEED")
    public boolean isNeed() {
        return isNeed;
    }

    public void setNeed(boolean need) {
        this.isNeed = need;
    }

    @Basic
    @Column(name = "IS_SHOW_COLUMN")
    public Integer getIsShowColumn() {
        return isShowColumn;
    }

    public void setIsShowColumn(Integer isShowColumn) {
        this.isShowColumn = isShowColumn;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        YcqCockpitModelColum floColumn = (YcqCockpitModelColum) o;
        return Objects.equals(id, floColumn.id) &&
                Objects.equals(modelId, floColumn.modelId) &&
                Objects.equals(name, floColumn.name) &&
                Objects.equals(type, floColumn.type) &&
                Objects.equals(isShowColumn, floColumn.isShowColumn) &&
                Objects.equals(intSize, floColumn.intSize) &&
                Objects.equals(decSize, floColumn.decSize) &&
                Objects.equals(remark, floColumn.remark) &&
                Objects.equals(createTime, floColumn.createTime) &&
                Objects.equals(createUser, floColumn.createUser) &&
                Objects.equals(status, floColumn.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, modelId, name, type, intSize, decSize, remark, createTime, createUser, status,isShowColumn);
    }
}
