package com.boman.domain.constant;


import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author shiqian
 * @date 2021年03月26日 09:47
 **/
public class FormDataConstant {

    /**
     * 删除数据时，需要删除的业务表的主键
     */
    public static final String ID_LIST = "idList";

    /**
     * id标识
     */
    public static final String ID = "id";

    /**
     * 查询的条件
     */
    public static final String CONDITION = "condition";

    /**
     * 查询后需要返回到前台的字段
     */
    public static final String SHOW_DATA = "showData";


    /**
     * equals
     */
    public static final String EQ = "EQ";

    /**
     * like
     */
    public static final String LIKE = "LIKE";

    /**
     * not equals
     */
    public static final String NE = "NE";

    /**
     * greater than
     */
    public static final String GT = "GT";

    /**
     * greater than or equal to
     */
    public static final String GTE = "GTE";

    /**
     * less than
     */
    public static final String LT = "LT";

    /**
     * less than or equal to
     */
    public static final String LTE = "LTE";

    /**
     * between and
     */
    public static final String BETWEEN = "BETWEEN";

    /**
     * 需要转义
     */
    public static final String VARCHAR = "varchar";

    public static final String BLOB = "blob";
    public static final String TINYBLOB = "tinyblob";
    public static final String MEDIUMBLOB = "mediumblob";
    public static final String LONGBLOB = "longblob";
    /**
     * Blob
     */
    public static final List<String> BLOB_LIST = Stream.of(BLOB, TINYBLOB, MEDIUMBLOB, LONGBLOB).collect(Collectors.toList());

    public static final String BYTE_ARRAY = "byte[]";

    public static final String CHAR = "char";
    public static final String DATETIME = "datetime";
    public static final String TIMESTAMP = "timestamp";

    /**  根据表名查询表单时，返回给前台的查询字段   */
    public static final String QUERY_LIST = "queryList";

    /**  根据表名查询表单时，返回给前台的按钮 (其实不是list而是 "AMDQSUE"的字符串 */
    public static final String BUTTON_LIST = "buttonList";

    /**  根据表名查询表单时，返回给前台列表展示的列*/
    public static final String TABLE_HEAD_LIST = "tableHeadList";
    /**
     * 查询主表的子表对象的头
     */
    public static final String REF = "ref";

    /**  分页  总条数*/
    public static final String PAGE_TOTAL = "total";

    /**  分页 总记录*/
    public static final String PAGE_ROWS = "rows";


    /**  暂时是用作新增时，成功的记录数 */
    public static final String SUCCESS_CNT = "successCnt";


    /**  数据库字段创建人*/
    public static final String UPDATE_BY = "UPDATE_BY";


    /**  数据库字段创建时间*/
    public static final String UPDATE_TIME = "UPDATE_TIME";

    /**  数据库字段创建人*/
    public static final String CREATE_BY = "create_by";

    /**  数据库字段创建时间*/
    public static final String CREATE_TIME = "create_time";


    /**  状态 */
    public static final String STATUS = "status";


    /**  单选框 */
    public static final String RADIO = "radio";


    /**  复选框 */
    public static final String CHECKBOX = "checkbox";


    /**  下拉框 */
    public static final String SELECT = "select";


    /**  需要查字典表的框框 */
    public static final List<String> NEED_QUERY_DICT_LIST = Stream.of(RADIO, CHECKBOX, SELECT).collect(Collectors.toList());

    /**  需要转换时间类型的 */
    public static final List<String> NEED_CONVERT_DATE_LIST = Stream.of(DATETIME).collect(Collectors.toList());

    /**  hr 日志、基础信息..... */
    public static final String HR = "hr";

    /**  返回单对象时，封装的name..... */
    public static final String SINGLE_OBJ_NAME = "name";

    /**  返回单对象时，封装的value..... */
    public static final String SINGLE_OBJ_VALUE = "value";

    /**  返回单对象时，封装的type，input、radio、checkbox、select.....中的其中一种 */
    public static final String SINGLE_OBJ_TYPE = "type";

    /**  返回单对象时，封装的types，input、radio、checkbox、select.....
     * 其中一种对应的所有值，比如：radio：要把男和女对应的信息全部返回给前台 */
    public static final String SINGLE_OBJ_TYPES = "types";


    /** 附件的url */
    public static final String URL = "url";
    /** fkTableName */
    public static final String FK_TABLE_NAME = "fkTableName";
    /** fkColumnName */
    public static final String FK_COLUMN_NAME = "fkColumnName";
    /** dkColumnName */
    public static final String DK_COLUMN_NAME = "dkColumnName";

    /** rules */
    public static final String RULES = "rules";
    public static final String TRIGGER = "trigger";
    public static final String MESSAGE = "message";
    public static final String PATTERN = "pattern";
    public static final String BLUR = "blur";
    public static final String REQUIRED = "required";

}
