@@ -71,18 +71,23 @@ protected static async Task<IActionResult> ExportAsync<TQuery, TExport>( //
7171 /// <param name="whereExp">查询表达式</param>
7272 /// <param name="whereSql">查询sql</param>
7373 /// <param name="ignoreVersion">是否忽略版本锁</param>
74+ /// <param name="disableGlobalDataFilter">是否忽略全局数据权限过滤</param>
7475 /// <returns>更新行数</returns>
7576 protected Task < int > UpdateAsync ( //
7677 TEntity newValue //
7778 , List < string > includeFields = null //
7879 , List < string > excludeFields = null //
7980 , Expression < Func < TEntity , bool > > whereExp = null //
8081 , string whereSql = null //
81- , bool ignoreVersion = false )
82+ , bool ignoreVersion = false , bool disableGlobalDataFilter = false )
8283 {
8384 // 默认匹配主键
8485 whereExp ??= a => a . Id . Equals ( newValue . Id ) ;
8586 var update = BuildUpdate ( newValue , includeFields , excludeFields , ignoreVersion ) . Where ( whereExp ) . Where ( whereSql ) ;
87+ if ( disableGlobalDataFilter ) {
88+ update = update . DisableGlobalFilter ( nameof ( Chars . FLG_FREE_SQL_GLOBAL_FILTER_DATA ) ) ;
89+ }
90+
8691 return update . ExecuteEffectsAsync ( ) ;
8792 }
8893
@@ -101,8 +106,8 @@ protected Task<List<TEntity>> UpdateReturnListAsync( //
101106 TEntity newValue //
102107 , List < string > includeFields = null //
103108 , List < string > excludeFields = null //
104- , Expression < Func < TEntity , bool > > whereExp = null //
105- , string whereSql = null //
109+ , Expression < Func < TEntity , bool > > whereExp = null //
110+ , string whereSql = null //
106111 , bool ignoreVersion = false )
107112 {
108113 // 默认匹配主键
0 commit comments