package cc.smtweb.system.bpm.web.design.form.define;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * Created by Akmm at 2022/4/20 18:15
 */ //字段要素
public class BaseDatasetField {
    public String id;
    //表
    public long table;
    public String table_text;
    //字段
    public String field = "";
    //有别名取别名，无别名同字段名
    public String name;
    public String label;

    public String remark;
    //字段类型，如编码字段，参见FieldTypeDef
    public int fieldType;
    /**
     * 数据类型，参见DataType
     */
    public String dataType;
    /**
     * '禁止为空'
     */
    public int notNull;
    //外键关联表
    public long link;
    //控件类型：TEXT/TextArea/NUMBER/COMBO
    public String editor;
    //param-参数/link/const/depend
    public String type;
    //type为link时，关联的数据集及字段
    public String linkDb;
    public String linkField;
    //type为const时，常量值
    public String value;
    // 默认值
    public String defValue;
    // type为depend时, 表达式
    public String dependExpr;

    @JsonIgnore
    public boolean isFieldNotNull() {
        return notNull == 1;
    }
}
