mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-17 21:49:33 +08:00
Synchronization code
This commit is contained in:
parent
e227e2f8a6
commit
593f6597f1
@ -716,6 +716,13 @@ namespace SqlSugar
|
||||
{
|
||||
return null;
|
||||
}
|
||||
public virtual string JsonIndex(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
var parameter1 = model.Args[1];
|
||||
return $"({parameter.MemberName}::json ->> {parameter1.MemberValue})";
|
||||
}
|
||||
|
||||
|
||||
public virtual string JsonField(MethodCallExpressionModel model)
|
||||
{
|
||||
|
@ -98,6 +98,7 @@ namespace SqlSugar
|
||||
string Exists(MethodCallExpressionModel model);
|
||||
string GetDateString(string dateValue,string format);
|
||||
string GetForXmlPath();
|
||||
string JsonIndex(MethodCallExpressionModel model);
|
||||
string JsonField(MethodCallExpressionModel model);
|
||||
string JsonContainsFieldName(MethodCallExpressionModel model);
|
||||
string JsonArrayLength(MethodCallExpressionModel model);
|
||||
|
@ -113,7 +113,10 @@ namespace SqlSugar
|
||||
{
|
||||
throw new NotSupportedException("Can only be used in expressions");
|
||||
}
|
||||
|
||||
public static string JsonIndex(object json, int jsonIndex)
|
||||
{
|
||||
throw new NotSupportedException("Can only be used in expressions");
|
||||
}
|
||||
public static string JsonField(object json, string fieldName,string includeFieldName)
|
||||
{
|
||||
throw new NotSupportedException("Can only be used in expressions");
|
||||
|
@ -17,6 +17,12 @@ namespace SqlSugar
|
||||
}
|
||||
public class MySqlMethod : DefaultDbMethod, IDbMethods
|
||||
{
|
||||
public override string JsonIndex(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
var parameter1 = model.Args[1];
|
||||
return $"JSON_UNQUOTE(JSON_EXTRACT({parameter.MemberName}, '$[{parameter1.MemberValue}]'))";
|
||||
}
|
||||
public override string WeekOfYear(MethodCallExpressionModel mode)
|
||||
{
|
||||
var parameterNameA = mode.Args[0].MemberName;
|
||||
|
@ -20,6 +20,12 @@ namespace SqlSugar
|
||||
}
|
||||
public partial class SqlServerMethod : DefaultDbMethod, IDbMethods
|
||||
{
|
||||
public override string JsonIndex(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
var parameter1 = model.Args[1];
|
||||
return $"JSON_VALUE({parameter.MemberName}, '$[{parameter1.MemberValue}]')";
|
||||
}
|
||||
public override string CharIndexNew(MethodCallExpressionModel model)
|
||||
{
|
||||
return string.Format("CHARINDEX ({1},{0})", model.Args[0].MemberName, model.Args[1].MemberName);
|
||||
|
Loading…
Reference in New Issue
Block a user