package com.njcn.influxdb.param;

import cn.hutool.core.text.StrPool;

/**
 * 拼接influx查询语句相关常量
 *
 * @author hongawen
 * @version 1.0.0
 * @date 2022年10月14日 14:02
 */
public interface InfluxDBSqlConstant {

    /**
     * "SELECT "
     */
    String SELECT = "SELECT" + StrPool.C_SPACE;

    /**
     * "* "
     */
    String ALL = "*" + StrPool.C_SPACE;

    /**
     * "FROM "
     */
    String FROM = "FROM" + StrPool.C_SPACE;

    /**
     * " WHERE "
     */
    String WHERE = StrPool.C_SPACE + "WHERE" + StrPool.C_SPACE;

    /**
     * " AND "
     */
    String AND = StrPool.C_SPACE + "AND" + StrPool.C_SPACE;

    /**
     * " OR "
     */
    String OR = StrPool.C_SPACE + "OR" + StrPool.C_SPACE;

    /**
     * " GROUP BY "
     */
    String GB = StrPool.C_SPACE + "GROUP BY" + StrPool.C_SPACE;

    /**
     * " ORDER BY "
     */
    String OB = StrPool.C_SPACE + "ORDER BY" + StrPool.C_SPACE;

    /**
     * “DESC ”
     */
    String DESC = "DESC" + StrPool.C_SPACE;

    /**
     * " as value "
     */
    String AS_VALUE = StrPool.C_SPACE + "as value" + StrPool.C_SPACE;

    String EQ = "=";
    String QM = "'";
    String LBK = "(";
    String RBK = ")";
    String GT = ">";
    String GE = ">=";
    String LT = "<";
    String LE = "<=";

    /**
     * influxDB函数拼接
     */
    String MAX = "MAX";
    String MIN = "MIN";
    String AVG = "MEAN";
    String NUM_95 = ",95";
    String CP95 = "PERCENTILE";

    /**
     * “ tz('Asia/Shanghai')”
     */
    String TZ = StrPool.C_SPACE + "tz('Asia/Shanghai')";
    String TIME_AREA = "Asia/Shanghai";


    /**
     * 日起始时间
     */
    String START_TIME = " 00:00:00";

    /**
     * 日结束时间
     */
    String END_TIME = " 23:59:59";

    /**
     * 时间
     */
    String TIME = "time" + StrPool.C_SPACE;

    /**
     * 每天固定时间分钟
     */
    Integer DAY_MINUTE = 1440;


}
