package com.phlx.anchorcollect_p.entity;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.databinding.BaseObservable;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

/**
 * 代码生成业务字段表 gen_table_column
 * 
 * @author ruoyi
 */
@Entity
public class GenTableColumn extends BaseObservable implements Parcelable {
    private static final long serialVersionUID = 1L;

    /** 编号 */
    @Id(autoincrement = false)
    private String columnId;

    /** 归属表编号 */
    private String tableId;

    /** 列名称 */
    private String columnName;

    /** 列描述 */
    private String columnComment;

    /** 列类型 */
    private String columnType;

    /** JAVA类型 */
    private String javaType;

    /** JAVA字段名 */
    private String javaField;

    /** 是否主键（1是） */
    private String isPk;

    /** 是否自增（1是） */
    private String isIncrement;

    /** 是否必填（1是） */
    private String isRequired;

    /**
     * 是否为插入字段（1是）新增时是否显示字段(暂时没有用到)
     */
    private String isInsert;

    /**
     * 是否编辑字段（1是）是否可以修改
     */
    private String isEdit;

    /**
     * 是否列表字段（1是）表头是否显示
     */
    private String isList;

    /**
     * 是否查询字段（1是）用来控制是否显示
     */
    private String isQuery;

    /** 查询方式（EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围） */
    private String queryType;

    /** 显示类型（input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、upload上传控件、summernote富文本控件） */
    private String htmlType;

    /** 字典类型 */
    private String dictType;

    /** 排序 */
    private Integer sort;

    //值
    private String content;

    //显示的名字
    private String showName;

    public GenTableColumn() {
    }

    protected GenTableColumn(Parcel in) {
        columnId = in.readString();
        tableId = in.readString();
        columnName = in.readString();
        columnComment = in.readString();
        columnType = in.readString();
        javaType = in.readString();
        javaField = in.readString();
        isPk = in.readString();
        isIncrement = in.readString();
        isRequired = in.readString();
        isInsert = in.readString();
        isEdit = in.readString();
        isList = in.readString();
        isQuery = in.readString();
        queryType = in.readString();
        htmlType = in.readString();
        dictType = in.readString();
        if (in.readByte() == 0) {
            sort = null;
        } else {
            sort = in.readInt();
        }
        content = in.readString();
        showName = in.readString();
    }

    @Generated(hash = 1178358944)
    public GenTableColumn(String columnId, String tableId, String columnName, String columnComment,
            String columnType, String javaType, String javaField, String isPk, String isIncrement,
            String isRequired, String isInsert, String isEdit, String isList, String isQuery, String queryType,
            String htmlType, String dictType, Integer sort, String content, String showName) {
        this.columnId = columnId;
        this.tableId = tableId;
        this.columnName = columnName;
        this.columnComment = columnComment;
        this.columnType = columnType;
        this.javaType = javaType;
        this.javaField = javaField;
        this.isPk = isPk;
        this.isIncrement = isIncrement;
        this.isRequired = isRequired;
        this.isInsert = isInsert;
        this.isEdit = isEdit;
        this.isList = isList;
        this.isQuery = isQuery;
        this.queryType = queryType;
        this.htmlType = htmlType;
        this.dictType = dictType;
        this.sort = sort;
        this.content = content;
        this.showName = showName;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(columnId);
        dest.writeString(tableId);
        dest.writeString(columnName);
        dest.writeString(columnComment);
        dest.writeString(columnType);
        dest.writeString(javaType);
        dest.writeString(javaField);
        dest.writeString(isPk);
        dest.writeString(isIncrement);
        dest.writeString(isRequired);
        dest.writeString(isInsert);
        dest.writeString(isEdit);
        dest.writeString(isList);
        dest.writeString(isQuery);
        dest.writeString(queryType);
        dest.writeString(htmlType);
        dest.writeString(dictType);
        if (sort == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(sort);
        }
        dest.writeString(content);
        dest.writeString(showName);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<GenTableColumn> CREATOR = new Creator<GenTableColumn>() {
        @Override
        public GenTableColumn createFromParcel(Parcel in) {
            return new GenTableColumn(in);
        }

        @Override
        public GenTableColumn[] newArray(int size) {
            return new GenTableColumn[size];
        }
    };

    public String getColumnId() {
        return columnId;
    }

    public void setColumnId(String columnId) {
        this.columnId = columnId;
    }

    public String getTableId() {
        return tableId;
    }

    public void setTableId(String tableId) {
        this.tableId = tableId;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getColumnComment() {
        return columnComment;
    }

    public void setColumnComment(String columnComment) {
        this.columnComment = columnComment;
    }

    public String getColumnType() {
        return columnType;
    }

    public void setColumnType(String columnType) {
        this.columnType = columnType;
    }

    public String getJavaType() {
        return javaType;
    }

    public void setJavaType(String javaType) {
        this.javaType = javaType;
    }

    public String getJavaField() {
        return javaField;
    }

    public void setJavaField(String javaField) {
        this.javaField = javaField;
    }

    public String getIsPk() {
        return isPk;
    }

    public void setIsPk(String isPk) {
        this.isPk = isPk;
    }

    public String getIsIncrement() {
        return isIncrement;
    }

    public void setIsIncrement(String isIncrement) {
        this.isIncrement = isIncrement;
    }

    public String getIsRequired() {
        return isRequired;
    }

    public void setIsRequired(String isRequired) {
        this.isRequired = isRequired;
    }

    public String getIsInsert() {
        return isInsert;
    }

    public void setIsInsert(String isInsert) {
        this.isInsert = isInsert;
    }

    public String getIsEdit() {
        return isEdit;
    }

    public void setIsEdit(String isEdit) {
        this.isEdit = isEdit;
    }

    public String getIsList() {
        return isList;
    }

    public void setIsList(String isList) {
        this.isList = isList;
    }

    public String getIsQuery() {
        return isQuery;
    }

    public void setIsQuery(String isQuery) {
        this.isQuery = isQuery;
    }

    public String getQueryType() {
        return queryType;
    }

    public void setQueryType(String queryType) {
        this.queryType = queryType;
    }

    public String getHtmlType() {
        return htmlType;
    }

    public void setHtmlType(String htmlType) {
        this.htmlType = htmlType;
    }

    public String getDictType() {
        return dictType;
    }

    public void setDictType(String dictType) {
        this.dictType = dictType;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getShowName() {
        return showName;
    }

    public void setShowName(String showName) {
        this.showName = showName;
    }

    @Override
    public String toString() {
        return "GenTableColumn{" +
                "columnId='" + columnId + '\'' +
                ", tableId='" + tableId + '\'' +
                ", columnName='" + columnName + '\'' +
                ", columnComment='" + columnComment + '\'' +
                ", columnType='" + columnType + '\'' +
                ", javaType='" + javaType + '\'' +
                ", javaField='" + javaField + '\'' +
                ", isPk='" + isPk + '\'' +
                ", isIncrement='" + isIncrement + '\'' +
                ", isRequired='" + isRequired + '\'' +
                ", isInsert='" + isInsert + '\'' +
                ", isEdit='" + isEdit + '\'' +
                ", isList='" + isList + '\'' +
                ", isQuery='" + isQuery + '\'' +
                ", queryType='" + queryType + '\'' +
                ", htmlType='" + htmlType + '\'' +
                ", dictType='" + dictType + '\'' +
                ", sort=" + sort +
                ", content='" + content + '\'' +
                ", showName='" + showName + '\'' +
                '}';
    }
}