From e75d50ba5a6dbe4561535bca490cac2a4ec4a4b0 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Thu, 1 Dec 2022 00:54:05 +0800 Subject: [PATCH] Add SqlFunc.JsonListObjectAny Add SqlFunc.JsonArrayAny --- .../ExpressionsToSql/DbMethods/DefaultDbMethod.cs | 8 ++++++++ .../SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs | 2 ++ .../SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs | 10 ++++++++++ .../ResolveItems/MethodCallExpressionResolve_Helper.cs | 4 ++++ 4 files changed, 24 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs index bc3849c5d..ed785a058 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs @@ -681,5 +681,13 @@ namespace SqlSugar model.Args[0].MemberName = name; return AggregateSum(model); } + public virtual string JsonListObjectAny(MethodCallExpressionModel model) + { + throw new NotImplementedException("Current database no support"); + } + public virtual string JsonArrayAny(MethodCallExpressionModel model) + { + throw new NotImplementedException("Current database no support"); + } } } diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs index b2197ee4d..828972fe7 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs @@ -100,5 +100,7 @@ namespace SqlSugar string JsonLike(MethodCallExpressionModel model); string Collate(MethodCallExpressionModel model); string AggregateSumNoNull(MethodCallExpressionModel model); + string JsonListObjectAny(MethodCallExpressionModel model); + string JsonArrayAny(MethodCallExpressionModel model); } } diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs index 2c4a44e0f..b9bc7c283 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs @@ -256,5 +256,15 @@ namespace SqlSugar public static DateTime Oracle_ToDate(string date,string format) { throw new NotSupportedException("Can only be used in expressions"); } public static string Oracle_ToChar(DateTime date, string format) { throw new NotSupportedException("Can only be used in expressions"); } public static int SqlServer_DateDiff(string dateType,DateTime date1,DateTime date2) { throw new NotSupportedException("Can only be used in expressions"); } + + public static void JsonListObjectAny(object jsonListObject, string fieldName, string value) + { + throw new NotSupportedException("Can only be used in expressions"); + } + + public static void JsonArrayAny(object jsonArray,string arrayValue) + { + throw new NotSupportedException("Can only be used in expressions"); + } } } diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_Helper.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_Helper.cs index 044016e65..ddf54097a 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_Helper.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_He