diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs index be10df526..298bc20c1 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpExpressionContext.cs @@ -104,6 +104,10 @@ namespace SqlSugar } public class KdbndpMethod : DefaultDbMethod, IDbMethods { + public override string CharIndex(MethodCallExpressionModel model) + { + return string.Format(" (strpos ({1},{0})-1)", model.Args[0].MemberName, model.Args[1].MemberName); + } public override string TrueValue() { return "true"; diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/Oscar/SqlBuilder/OscarExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar/Realization/Oscar/SqlBuilder/OscarExpressionContext.cs index 445494e5e..d4514c5e6 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/Oscar/SqlBuilder/OscarExpressionContext.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/Oscar/SqlBuilder/OscarExpressionContext.cs @@ -98,6 +98,10 @@ namespace SqlSugar } public class OscarLMethod : DefaultDbMethod, IDbMethods { + public override string CharIndex(MethodCallExpressionModel model) + { + return string.Format(" (strpos ({1},{0})-1)", model.Args[0].MemberName, model.Args[1].MemberName); + } public override string IIF(MethodCallExpressionModel model) { var parameter = model.Args[0]; diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs index b74148165..c724835c1 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs @@ -133,6 +133,10 @@ namespace SqlSugar } public class PostgreSQLMethod : DefaultDbMethod, IDbMethods { + public override string CharIndex(MethodCallExpressionModel model) + { + return string.Format(" (strpos ({1},{0})-1)", model.Args[0].MemberName, model.Args[1].MemberName); + } public override string TrueValue() { return "true";