package com.boman.domain;

import java.util.List;
import java.util.Map;

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

    /** 是查询字段 */
    public static final String IS_QUERY = "1";

    /** 主键 */
    public static final String IS_PK = "1";

    /** 必填 */
    public static final String IS_REQUIRED = "1";

    /** 编号 */
    private Long id;

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

    /** 归属表名 数据库没有此字段*/
    private String tableName;

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

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

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

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

    /** JAVA字段名 */
    //@NotBlank(message = "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日期控件、image图片上传控件、upload文件上传控件、editor富文本控件） */
    private String htmlType;

    /**
     * 外键(表明该表哪个字段是外键,取值id)
     */
    private Long foreignKey;

    /**
     * 外键名称(仅仅给前端展示使用)
     */
    private String foreignKeyName;

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

    /** 排序 */
    private Integer sort;

    /** 如果是下拉框，单选，复选框 对应的子节点的值 */
    private List<SysDictData> sysDictData;

    /** 哪些字段属于这些hr的 */
    private Long hrParentId;
    /**
     * hr名称(仅仅给前端展示使用)
     */
    private String hrParentName;

    /** hr的孩子们 */
    private List<GenTableColumn> hrChildren;

    /**
     * 字段排序规则
     */
    private String mask;
    /**
     * 默认值
     */
    private String defaultValue;

    /**
     * 行数
     */
    private String numRows;
    /**
     * 列数
     */
    private String numColumns;

    /**
     * 字段翻译器
     */
    private String fieldTranslator;

    /**
     * 扩展属性 eg：{"col":["start_time","end_time"],"comp":"end_time-start_time"}
     */
    private String extendedAttributes;

    /**
     *是否输入 Y是
     */
    private String isIn;

    /**
     * 是否显示 Y是
     */
    private String isOut;

    /**
     * 此列对应的值
     */
    private Object columnValue;

    /**
     * 正则表达式
     */
    private String regular;

    /**
     * readonly， 前端回显的时候，判断是否可编辑
     */
    private boolean readonly;

    /**
     * 查询时：{"fkTableName":"外键表的表名", "fkColumnName":"关联外键表的列名", "dkColumnName":"关联表需要展示的字段名"}
     * 根据列名获取关联表字段的值和名称{"name":"12", "value":"dept_id"}
     */
    private Map<String, Object> fkInfo;

    private List<SysFile> annex;

    /**
     * 前端单对象展示样式
     */
    private String cssClass;
    /**
     * 表.字段全称
     */
    private String tableColumnName;
    /**
     * 前端再计算的时候，是否用到该列的扩展属性 extendedAttributes
     */
    private Boolean isUseExtend;
    /**
     * 单据编号规则表名称
     */
    private String seqName;

    public String getSeqName() {
        return seqName;
    }

    public void setSeqName(String seqName) {
        this.seqName = seqName;
    }

    public Boolean getIsUseExtend() {
        return isUseExtend;
    }

    public void setIsUseExtend(Boolean isUseExtend) {
        this.isUseExtend = isUseExtend;
    }

    public String getTableColumnName() {
        return tableColumnName;
    }

    public void setTableColumnName(String tableColumnName) {
        this.tableColumnName = tableColumnName;
    }

    public String getCssClass() {
        return cssClass;
    }

    public void setCssClass(String cssClass) {
        this.cssClass = cssClass;
    }

    public List<SysFile> getAnnex() {
        return annex;
    }

    public void setAnnex(List<SysFile> annex) {
        this.annex = annex;
    }

    public Map<String, Object> getFkInfo() {
        return fkInfo;
    }

    public void setFkInfo(Map<String, Object> fkInfo) {
        this.fkInfo = fkInfo;
    }

    public String getRegular() {
        return regular;
    }

    public void setRegular(String regular) {
        this.regular = regular;
    }

    public String getFieldTranslator() {
        return fieldTranslator;
    }

    public void setFieldTranslator(String fieldTranslator) {
        this.fieldTranslator = fieldTranslator;
    }

    public String getExtendedAttributes() {
        return extendedAttributes;
    }

    public void setExtendedAttributes(String extendedAttributes) {
        this.extendedAttributes = extendedAttributes;
    }

    public String getIsIn() {
        return isIn;
    }

    public void setIsIn(String isIn) {
        this.isIn = isIn;
    }

    public String getIsOut() {
        return isOut;
    }

    public void setIsOut(String isOut) {
        this.isOut = isOut;
    }

    public String getMask() {
        return mask;
    }

    public void setMask(String mask) {
        this.mask = mask;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public String getNumRows() {
        return numRows;
    }

    public void setNumRows(String numRows) {
        this.numRows = numRows;
    }

    public String getNumColumns() {
        return numColumns;
    }

    public void setNumColumns(String numColumns) {
        this.numColumns = numColumns;
    }

    public Long getForeignKey() {
        return foreignKey;
    }

    public void setForeignKey(Long foreignKey) {
        this.foreignKey = foreignKey;
    }

    public String getForeignKeyName() {
        return foreignKeyName;
    }

    public void setForeignKeyName(String foreignKeyName) {
        this.foreignKeyName = foreignKeyName;
    }

    public String getHrParentName() {
        return hrParentName;
    }

    public void setHrParentName(String hrParentName) {
        this.hrParentName = hrParentName;
    }

    public Long getId() {
        return id;
    }

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

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

    public Long getTableId()
    {
        return tableId;
    }

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

    public String getColumnName()
    {
        return columnName;
    }

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

    public String getColumnComment()
    {
        return columnComment;
    }

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

    public String getColumnType()
    {
        return columnType;
    }

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

    public String getJavaType()
    {
        return javaType;
    }

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

    public String getJavaField()
    {
        return javaField;
    }

//    public String getCapJavaField()
//    {
//        return StringUtils.capitalize(javaField);
//    }

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

    public String getIsPk()
    {
        return isPk;
    }

//    public boolean isPk()
//    {
//        return isPk(this.isPk);
//    }

//    public boolean isPk(String isPk)
//    {
//        return isPk != null && StringUtils.equals("1", isPk);
//    }

    public String getIsIncrement()
    {
        return isIncrement;
    }

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

//    public boolean isIncrement()
//    {
//        return isIncrement(this.isIncrement);
//    }

//    public boolean isIncrement(String isIncrement)
//    {
//        return isIncrement != null && StringUtils.equals("1", isIncrement);
//    }

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

    public String getIsRequired()
    {
        return isRequired;
    }

//    public boolean isRequired()
//    {
//        return isRequired(this.isRequired);
//    }

//    public boolean isRequired(String isRequired)
//    {
//        return isRequired != null && StringUtils.equals("1", isRequired);
//    }

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

    public String getIsInsert()
    {
        return isInsert;
    }

//    public boolean isInsert()
//    {
//        return isInsert(this.isInsert);
//    }

//    public boolean isInsert(String isInsert)
//    {
//        return isInsert != null && StringUtils.equals("1", isInsert);
//    }

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

    public String getIsEdit()
    {
        return isEdit;
    }

//    public boolean isEdit()
//    {
//        return isInsert(this.isEdit);
//    }

//    public boolean isEdit(String isEdit)
//    {
//        return isEdit != null && StringUtils.equals("1", isEdit);
//    }

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

    public String getIsList()
    {
        return isList;
    }

//    public boolean isList()
//    {
//        return isList(this.isList);
//    }
//
//    public boolean isList(String isList)
//    {
//        return isList != null && StringUtils.equals("1", isList);
//    }

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

    public String getIsQuery()
    {
        return isQuery;
    }

//    public boolean isQuery()
//    {
//        return isQuery(this.isQuery);
//    }

//    public boolean isQuery(String isQuery)
//    {
//        return isQuery != null && StringUtils.equals("1", isQuery);
//    }

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

    public String getQueryType()
    {
        return queryType;
    }

    public String getHtmlType()
    {
        return htmlType;
    }

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

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

    public String getDictType()
    {
        return dictType;
    }

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

    public Integer getSort()
    {
        return sort;
    }

//    public boolean isSuperColumn()
//    {
//        return isSuperColumn(this.javaField);
//    }
//
//    public static boolean isSuperColumn(String javaField)
//    {
//        return StringUtils.equalsAnyIgnoreCase(javaField,
//                // BaseEntity
//                "createBy", "createTime", "updateBy", "updateTime", "remark",
//                // TreeEntity
//                "parentName", "parentId", "orderNum", "ancestors");
//    }

//    public boolean isUsableColumn()
//    {
//        return isUsableColumn(javaField);
//    }

//    public static boolean isUsableColumn(String javaField)
//    {
//        // isSuperColumn()中的名单用于避免生成多余Domain属性，若某些属性在生成页面时需要用到不能忽略，则放在此处白名单
//        return StringUtils.equalsAnyIgnoreCase(javaField, "parentId", "orderNum", "remark");
//    }

//    public String readConverterExp()
//    {
//        String remarks = StringUtils.substringBetween(this.columnComment, "（", "）");
//        StringBuffer sb = new StringBuffer();
//        if (StringUtils.isNotEmpty(remarks))
//        {
//            for (String value : remarks.split(" "))
//            {
//                if (StringUtils.isNotEmpty(value))
//                {
//                    Object startStr = value.subSequence(0, 1);
//                    String endStr = value.substring(1);
//                    sb.append("").append(startStr).append("=").append(endStr).append(",");
//                }
//            }
//            return sb.deleteCharAt(sb.length() - 1).toString();
//        }
//        else
//        {
//            return this.columnComment;
//        }
//    }

    public List<SysDictData> getSysDictData() {
        return sysDictData;
    }

    public void setSysDictData(List<SysDictData> sysDictData) {
        this.sysDictData = sysDictData;
    }

    public Long getHrParentId() {
        return hrParentId;
    }

    public void setHrParentId(Long hrParentId) {
        this.hrParentId = hrParentId;
    }

    public List<GenTableColumn> getHrChildren() {
        return hrChildren;
    }

    public void setHrChildren(List<GenTableColumn> hrChildren) {
        this.hrChildren = hrChildren;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Object getColumnValue() {
        return columnValue;
    }

    public void setColumnValue(Object columnValue) {
        this.columnValue = columnValue;
    }

    public boolean isReadonly() {
        return readonly;
    }

    public void setReadonly(boolean readonly) {
        this.readonly = readonly;
    }
}