package com.abcxin.smart.core.persistence.utils;

/**
 * DAO层操作常量
 * Created by subh on 2019/2/4.
 */
public interface Constants {

    /***
     * 操作用户为系统
     */
    public static final String OPERATION_SYSTEM = "system";
    /***
     * 操作用户为系统名称
     */
    public static final String OPERATION_SYSTEM_REALNAME = "系统";

    /***
     * 主键为空
     */
    public static final String ID_EMPTY = "?";

    /***
     * 主键
     */
    public static final String ID = "id";
    /***
     * 空字符
     */
    public static final String EMPTY = "";
    /***
     * 替换字符getResource.do
     */
    public static final String REPLACE_GETRESOURCE = "getResource.do";
    /***
     * 替换字符getResource.donull
     */
    public static final String REPLACE_GETRESOURCENULL = "getResource.donull";
    /***
     * 当前用户
     */
    public static final String CURRENTUSER = "user";
    /***
     * 时间格式
     */
    public static final String FORMAT_TIME ="yyyy-MM-dd HH:mm:ss";

    /***
     * 更新前
     */
    public static final String BEFORE ="BEFORE";
    /***
     * 操作类型为update
     */
    public static final String UPDATE ="update";

    /***
     * 获取序列号SQL语句
     */
    public static final String SEQ_TRILOGID_SQL ="SELECT nextval('seq_triLogId')";

    /***
     * 日志SQL语句
     */
    public static final String INSERT_TRILOG_SQL ="INSERT INTO `tri_log` (`triLogId`, `createTime`, `triType`, `ddlType`, `tableName`, `tablePrmKey`, `dbUser`,`dbUserRealName`) VALUES (?, ?, ?, ?, ?, ?, ?, ? )";

    /***
     * 日志详细SQL语句
     */
    public static final String INSERT_TRILOGDETAIL_SQL ="INSERT INTO `tri_log_detail` (`createTime`, `changeColumn`, `oldValue`, `newValue`, `triLogId`) VALUES (?, ?, ?, ?, ?)";
    /***
     * SQL详细SQL语句
     */
    public static final String INSERT_OPERATIONSQLLOG_SQL ="insert into operationSqlLog(`create_time`,`sqlId`,`sql`,`id`) VALUES(?,?,?,?)";

    public static final String SINGLE_QUOTES ="'";
    public static final String PATH ="config/trilog/trilog";

}

