diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/FastestProvider/FastBuilder.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/FastestProvider/FastBuilder.cs index c2a3c1e01..b94adb71a 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/FastestProvider/FastBuilder.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/FastestProvider/FastBuilder.cs @@ -31,7 +31,7 @@ namespace SqlSugar Check.ArgumentNullException(!updateColumns.Any(), "update columns count is 0"); Check.ArgumentNullException(!whereColumns.Any(), "where columns count is 0"); var sets = string.Join(",", updateColumns.Select(it => $"TM.{sqlbuilder.GetTranslationColumnName(it)}=TE.{sqlbuilder.GetTranslationColumnName(it)}")); - var wheres = string.Join(",", whereColumns.Select(it => $"TM.{sqlbuilder.GetTranslationColumnName(it)}=TE.{sqlbuilder.GetTranslationColumnName(it)}")); + var wheres = string.Join(" AND ", whereColumns.Select(it => $"TM.{sqlbuilder.GetTranslationColumnName(it)}=TE.{sqlbuilder.GetTranslationColumnName(it)}")); string sql = string.Format(UpdateSql, sets, tableName, tempName, wheres); return await this.Context.Ado.ExecuteCommandAsync(sql); } diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs index 7c578d414..1878ad8a7 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs @@ -491,7 +491,7 @@ namespace SqlSugar } public string GetSqlQuerySql(string result) { - if (this.IsSqlQuery && (Skip == null && Take == null)) + if (this.IsSqlQuery && (Skip == null && Take == null)&&(this.WhereInfos==null||this.WhereInfos.Count==0)) { var old = result; var regex = @"^SELECT .* FROM \(((.|\n|\r)*)\) t $"; @@ -543,6 +543,10 @@ namespace SqlSugar { return "*"; } + if (result.Contains("/**/*")) + { + return result.Replace("/**/*", ""); + } if (result.Contains(".*") && this.IsSingle()) { return "*"; diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/DbMethods/SqlFuncExtendsion.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/DbMethods/SqlFuncExtendsion.cs index e9e9bc18e..ab35c49bf 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/DbMethods/SqlFuncExtendsion.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/DbMethods/SqlFuncExtendsion.cs @@ -23,5 +23,9 @@ namespace SqlSugar { throw new NotSupportedException("Can only be used in expressions"); } + public static FieldType SelectAll(this FieldType field,string singleTableQueryShortName) + { + throw new NotSupportedException("Can only be used in expressions"); + } } } \ No newline at end of file diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs index ada666092..d2780ad16 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs @@ -322,7 +322,13 @@ namespace SqlSugar if (name.IsIn("GetSelfAndAutoFill","SelectAll")) { var memberValue = (args.First() as MemberExpression).Expression.ToString(); - model.Args.Add(new MethodCallExpressionArgs() { MemberValue = memberValue, IsMember = true, MemberName = memberValue }); + var data = new MethodCallExpressionArgs() { MemberValue = memberValue, IsMember = true, MemberName = memberValue }; + model.Args.Add(data); + if (args.Count() == 2) + { + data.MemberName = (args.Last()).ToString(); + data.MemberValue = "." ; + } } else { @@ -773,7 +779,12 @@ namespace SqlSugar case "SelectAll": case "GetSelfAndAutoFill": this.Context.Parameters.RemoveAll(it => it.ParameterName == model.Args[0].MemberName.ObjToString()); - return this.Context.DbMehtods.GetSelfAndAutoFill(model.Args[0].MemberValue.ObjToString(), this.Context.IsSingle); + var result1= this.Context.DbMehtods.GetSelfAndAutoFill(model.Args[0].MemberValue.ObjToString(), this.Context.IsSingle); + if ((model.Args[0].MemberValue+"") == "."&&this.Context.IsSingle) + { + result1 =this.Context.GetTranslationTableName(model.Args[0].MemberName+"",false)+".*/**/" + result1; + } + return result1; case "GetDate": return this.Context.DbMehtods.GetDate(); case "GetRandom": diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs index 01a051deb..90b6759f2 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/DbBind/PostgreSQLDbBind.cs @@ -116,7 +116,8 @@ namespace SqlSugar new KeyValuePair("bit varying",CSharpDataType.byteArray), new KeyValuePair("varbit",CSharpDataType.@byte), new KeyValuePair("time",CSharpDataType.TimeSpan), - new KeyValuePair("public.geometry",CSharpDataType.@object) + new KeyValuePair("public.geometry",CSharpDataType.@object), + new KeyValuePair("inet",CSharpDataType.@object) }; public override List StringThrow { diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLFastBuilder.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLFastBuilder.cs index f52bed1e4..b56ac7732 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLFastBuilder.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLFastBuilder.cs @@ -125,7 +125,7 @@ namespace SqlSugar Check.ArgumentNullException(!updateColumns.Any(), "update columns count is 0"); Check.ArgumentNullException(!whereColumns.Any(), "where columns count is 0"); var sets = string.Join(",", updateColumns.Select(it => $"{sqlquerybulder.GetTranslationColumnName(it)}=TE.{sqlquerybulder.GetTranslationColumnName(it)}")); - var wheres = string.Join(",", whereColumns.Select(it => $"{tableName}.{sqlquerybulder.GetTranslationColumnName(it)}=TE.{sqlquerybulder.GetTranslationColumnName(it)}")); + var wheres = string.Join(" AND ", whereColumns.Select(it => $"{tableName}.{sqlquerybulder.GetTranslationColumnName(it)}=TE.{sqlquerybulder.GetTranslationColumnName(it)}")); string sql = string.Format(UpdateSql, sets, tableName, tempName, wheres); return await this.Context.Ado.ExecuteCommandAsync(sql); }