using DS.WMS.Core.TaskInteraction.Dtos; using DS.WMS.Core.TaskInteraction.Interface; using SqlSugar; namespace DS.WMS.Core.TaskInteraction.Method.DataProvider { /// /// 默认数据库提供程序 /// public class DefaultDatabaseProvider : ServiceBase, IDataProvider { /// /// 初始化 /// /// public DefaultDatabaseProvider(IServiceProvider provider) : base(provider) { } /// /// 执行数据库查询 /// /// /// public async Task FetchDataAsync(DataFetchContext context) { SugarParameter[] sugarParams = [ new SugarParameter(nameof(context.BusinessId), context.BusinessId, System.Data.DbType.Int64), new SugarParameter(nameof(context.BusinessType), context.BusinessType, System.Data.DbType.Int32), ]; context.Data = await TenantDb.Ado.SqlQueryAsync(context.Content, sugarParams); } } }