using SqlSugar;
using System.Collections.Generic;
using System.Data;
using ZR.Common;
using ZR.Repository;
namespace ZR.Service
{
///
/// 基础服务定义
///
///
public class BaseService : BaseRepository where T : class, new()
{
//public IBaseRepository baseRepository;
//public BaseService(IBaseRepository repository)
//{
// this.baseRepository = repository ?? throw new ArgumentNullException(nameof(repository));
//}
#region 获取序列号
private readonly object LockDbFlag = new object();
public object GetSequenceNo(string SqCode)
{
lock (LockDbFlag)
{
SugarParameter parameter1 = new("seq_code", SqCode)
{
Direction = ParameterDirection.Input,
};
SugarParameter parameter2 = new("count_num", 1)
{
Direction = ParameterDirection.Input,
};
SugarParameter parameter3 = new("out_id", default)
{
Direction = ParameterDirection.Output,
};
var RetVal = UseStoredProcedureToTuple("sys_proc_get_sequences", new List { parameter1, parameter2 , parameter3 });
return parameter3.Value;
}
}
#endregion
}
}