diff --git a/Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/ClickHouseProvider.cs b/Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/ClickHouseProvider.cs index 18894a886..d5ff23d29 100644 --- a/Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/ClickHouseProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/ClickHouseProvider.cs @@ -133,6 +133,10 @@ namespace SqlSugar.ClickHouse param.Value = Guid.Empty; } } + if (dbtype.ObjToString() == System.Data.DbType.SByte.ToString()) + { + dbtype = ClickHouseDbBind.MappingTypesConst.First(it => it.Value == CSharpDataType.@sbyte).Key; + } if (param.Value!=null&¶m.Value!=DBNull.Value&&dbtype.ObjToString() == System.Data.DbType.Boolean.ToString()) { sql = sql.Replace(param.ParameterName, param.Value.ObjToBool()?"1":"0"); diff --git a/Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/DbBind/ClickHouseDbBind.cs b/Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/DbBind/ClickHouseDbBind.cs index f4c76747e..5ff879b3b 100644 --- a/Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/DbBind/ClickHouseDbBind.cs +++ b/Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/DbBind/ClickHouseDbBind.cs @@ -67,8 +67,8 @@ namespace SqlSugar.ClickHouse new KeyValuePair("UInt32",CSharpDataType.@int), new KeyValuePair("UInt16",CSharpDataType.@short), new KeyValuePair("UInt64",CSharpDataType.@long), - new KeyValuePair("Int8",CSharpDataType.@int), - new KeyValuePair("UInt8",CSharpDataType.@int), + new KeyValuePair("Int8",CSharpDataType.@sbyte), + new KeyValuePair("UInt8",CSharpDataType.@byte), new KeyValuePair("Decimal(38,19)",CSharpDataType.@decimal), new KeyValuePair("Decimal",CSharpDataType.@decimal), new KeyValuePair("Decimal32",CSharpDataType.@decimal), diff --git a/Src/Asp.NetCore2/SqlSugar/Enum/ProperyType.cs b/Src/Asp.NetCore2/SqlSugar/Enum/ProperyType.cs index 9ec673439..2ce145aec 100644 --- a/Src/Asp.NetCore2/SqlSugar/Enum/ProperyType.cs +++ b/Src/Asp.NetCore2/SqlSugar/Enum/ProperyType.cs @@ -15,6 +15,7 @@ namespace SqlSugar @double, @Guid, @byte, + @sbyte, @enum, @short, @long, diff --git a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs index c04b267b3..f0518e03d 100644 --- a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs +++ b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs @@ -110,6 +110,10 @@ namespace SqlSugar { this.DbType = System.Data.DbType.Byte; } + else if (type == UtilConstants.SByteType) + { + this.DbType = System.Data.DbType.SByte; + } else if (type == UtilConstants.FloatType) { this.DbType = System.Data.DbType.Single; diff --git a/Src/Asp.NetCore2/SqlSugar/Utilities/UtilConstants.cs b/Src/Asp.NetCore2/SqlSugar/Utilities/UtilConstants.cs index 6387f7f01..5aee5dc5f 100644 --- a/Src/Asp.NetCore2/SqlSugar/Utilities/UtilConstants.cs +++ b/Src/Asp.NetCore2/SqlSugar/Utilities/UtilConstants.cs @@ -24,6 +24,7 @@ namespace SqlSugar internal static Type BoolType = typeof(bool); internal static Type BoolTypeNull = typeof(bool?); internal static Type ByteType = typeof(Byte); + internal static Type SByteType = typeof(sbyte); internal static Type ObjType = typeof(object); internal static Type DobType = typeof(double); internal static Type FloatType = typeof(float);