12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using SqlSugar;
- using System.Collections.Generic;
- using System.Data;
- using ZR.Common;
- using ZR.Repository;
- namespace ZR.Service
- {
- /// <summary>
- /// 基础服务定义
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public class BaseService<T> : BaseRepository<T> where T : class, new()
- {
- //public IBaseRepository<T> baseRepository;
- //public BaseService(IBaseRepository<T> 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<SugarParameter> { parameter1, parameter2 , parameter3 });
- return parameter3.Value;
- }
- }
- #endregion
- }
- }
|