using Long.Common.System;
using Long.Dapper;

namespace Long.DAO.System
{
    /// <summary>
    /// 下一个值-数据库
    /// </summary>
    public interface INextValueDatabase: IDatabase<NextValue>
    {
        #region 获取编码

        /// <summary>
        /// 获取编码
        /// </summary>
        /// <param name="prefix">前缀</param>
        /// <param name="tableName">表名</param>
        /// <param name="fieldName">字段名</param>
        /// <param name="defaultValue">默认值</param>
        /// <param name="length">编码长度</param>
        /// <returns></returns>
        Task<string> GetCodeAsync(string prefix, string tableName, string fieldName, int defaultValue = 1, int length = 5);

        #endregion

        #region 获取日期编码

        /// <summary>
        /// 获取日期编码
        /// </summary>
        /// <param name="prefix">前缀</param>
        /// <param name="tableName">表名</param>
        /// <param name="fieldName">字段名</param>
        /// <param name="defaultValue">默认值</param>
        /// <param name="length">日期后编码长度</param>
        /// <returns></returns>
        Task<string> ExcuteGetCodeFromDateAsync(string prefix, string tableName, string fieldName, long defaultValue = 1, int length = 5);

        #endregion
    }
}
