package com.jay.monitor.data.server.models.entity.es;

import com.jay.monitor.data.server.anno.ESSearch;
import com.jay.monitor.data.server.enums.ESQuerySyntax;
import org.zxp.esclientrhl.annotation.ESID;
import org.zxp.esclientrhl.annotation.ESMetaData;

import java.util.Date;

@ESMetaData(indexName = "jay_monitor_sql", number_of_shards = 5, number_of_replicas = 0, printLog = true)
public class JayMonitorSQLIndex {

    @ESID
    private String id;

    private String ip;

    private String applicationName;

    private String groupName;

    private String groupKeyName;

    private String dataId;

    private String logId;

    @ESSearch(value = ESQuerySyntax.gt)
    private Integer affectedRows;

    @ESSearch(value = ESQuerySyntax.like)
    private String jsonContent;

    @ESSearch(value = ESQuerySyntax.gt)
    private Long requestTime;

    /**
     * 执行命令
     */
    private String commandType;
    /**
     * sql编号
     */
    private String sqlId;
    /**
     * 表名称
     */
    private String table;
    /**
     * SQL 语句
     */
    private String sql;

    /**
     * 结果返回
     */
    private Object result;

    /**
     * 创建时间
     */
    private Date createDate;

    /**
     * 状态
     */
    private Integer status;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getApplicationName() {
        return applicationName;
    }

    public void setApplicationName(String applicationName) {
        this.applicationName = applicationName;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getGroupKeyName() {
        return groupKeyName;
    }

    public void setGroupKeyName(String groupKeyName) {
        this.groupKeyName = groupKeyName;
    }

    public String getDataId() {
        return dataId;
    }

    public void setDataId(String dataId) {
        this.dataId = dataId;
    }

    public String getLogId() {
        return logId;
    }

    public void setLogId(String logId) {
        this.logId = logId;
    }

    public String getId() {
        return id;
    }

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

    public Integer getAffectedRows() {
        return affectedRows;
    }

    public void setAffectedRows(Integer affectedRows) {
        this.affectedRows = affectedRows;
    }

    public String getJsonContent() {
        return jsonContent;
    }

    public void setJsonContent(String jsonContent) {
        this.jsonContent = jsonContent;
    }

    public Long getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(Long requestTime) {
        this.requestTime = requestTime;
    }

    public String getCommandType() {
        return commandType;
    }

    public void setCommandType(String commandType) {
        this.commandType = commandType;
    }

    public String getSqlId() {
        return sqlId;
    }

    public void setSqlId(String sqlId) {
        this.sqlId = sqlId;
    }

    public String getTable() {
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
