diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs index 993693601..efbeedc16 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs @@ -76,7 +76,7 @@ namespace SqlSugar } - public IDataReaderEntityBuilder(SqlSugarProvider context, IDataRecord dataRecord,List fieldNames) + public IDataReaderEntityBuilder(SqlSugarProvider context, IDataRecord dataRecord, List fieldNames) { this.Context = context; this.DataRecord = dataRecord; @@ -104,7 +104,7 @@ namespace SqlSugar foreach (var columnInfo in columnInfos) { string fileName = columnInfo.DbColumnName ?? columnInfo.PropertyName; - if (columnInfo.IsIgnore&& !this.ReaderKeys.Any(it=>it.Equals(fileName,StringComparison.CurrentCultureIgnoreCase))) + if (columnInfo.IsIgnore && !this.ReaderKeys.Any(it => it.Equals(fileName, StringComparison.CurrentCultureIgnoreCase))) { continue; } @@ -114,7 +114,7 @@ namespace SqlSugar { if (this.ReaderKeys.Any(it => it.Equals(fileName, StringComparison.CurrentCultureIgnoreCase))) { - BindClass(generator, result, columnInfo,ReaderKeys.First(it => it.Equals(fileName, StringComparison.CurrentCultureIgnoreCase))); + BindClass(generator, result, columnInfo, ReaderKeys.First(it => it.Equals(fileName, StringComparison.CurrentCultureIgnoreCase))); } } else @@ -176,7 +176,8 @@ namespace SqlSugar MethodInfo method = null; Type bindPropertyType = UtilMethods.GetUnderType(columnInfo.PropertyInfo, ref isNullableType); string dbTypeName = UtilMethods.GetParenthesesValue(DataRecord.GetDataTypeName(ordinal)); - if (dbTypeName.IsNullOrEmpty()) { + if (dbTypeName.IsNullOrEmpty()) + { dbTypeName = bindPropertyType.Name; } string propertyName = columnInfo.PropertyName; @@ -249,7 +250,7 @@ namespace SqlSugar CheckType(bind.DateThrow, bindProperyTypeName, validPropertyName, propertyName); if (bindProperyTypeName == "datetime") method = isNullableType ? getConvertDateTime : getDateTime; - if (bindProperyTypeName == "datetime"&&dbTypeName.ToLower() == "time") + if (bindProperyTypeName == "datetime" && dbTypeName.ToLower() == "time") method = isNullableType ? getConvertTime : getTime; break; case CSharpDataType.@decimal: @@ -260,11 +261,12 @@ namespace SqlSugar case CSharpDataType.@float: case CSharpDataType.@double: CheckType(bind.DoubleThrow, bindProperyTypeName, validPropertyName, propertyName); - if (bindProperyTypeName.IsIn( "double", "single")&&dbTypeName!="real") + if (bindProperyTypeName.IsIn("double", "single") && dbTypeName != "real") method = isNullableType ? getConvertDouble : getDouble; else method = isNullableType ? getConvertFloat : getFloat; - if (dbTypeName.Equals("float",StringComparison.CurrentCultureIgnoreCase) && isNullableType && bindProperyTypeName.Equals("single",StringComparison.CurrentCultureIgnoreCase)) { + if (dbTypeName.Equals("float", StringComparison.CurrentCultureIgnoreCase) && isNullableType && bindProperyTypeName.Equals("single", StringComparison.CurrentCultureIgnoreCase)) + { method = getConvertDoubleToFloat; } if (bindPropertyType == UtilConstants.DecType) diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Enum/ProperyType.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Enum/ProperyType.cs index aebbc054e..9ec673439 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Enum/ProperyType.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Enum/ProperyType.cs @@ -25,6 +25,6 @@ namespace SqlSugar @time, @DateTimeOffset, @Single, - @TimeSpan + @TimeSpan } } diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/ContextMethods.cs index 5892d3fd9..a8d7ea72a 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/ContextMethods.cs @@ -311,6 +311,10 @@ namespace SqlSugar { addValue = Convert.ToInt32(addValue); } + else if (UtilMethods.GetUnderType(item.PropertyType) == UtilConstants.LongType) + { + addValue = Convert.ToInt64(addValue); + } result.Add(name, addValue); } } diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/Oracle/SqlBuilder/OracleExpressionContext.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/Oracle/SqlBuilder/OracleExpressionContext.cs index 017251037..218fb722a 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/Oracle/SqlBuilder/OracleExpressionContext.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/Oracle/SqlBuilder/OracleExpressionContext.cs @@ -40,6 +40,12 @@ namespace SqlSugar } public partial class OracleMethod : DefaultDbMethod, IDbMethods { + public override string ToInt64(MethodCallExpressionModel model) + { + var parameter = model.Args[0]; + return string.Format(" CAST({0} AS Number)", parameter.MemberName); + } + public override string ToTime(MethodCallExpressionModel model) { var parameter = model.Args[0]; diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLBuilder.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLBuilder.cs index be576f9ab..b64ffd241 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLBuilder.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLBuilder.cs @@ -73,7 +73,7 @@ namespace SqlSugar } else if (name.Contains("(")) { - return name.ToLower(); + return name; } else if (name.Contains(SqlTranslationLeft) && name.Contains(SqlTranslationRight)) {