Merge branch 'master' of gitee.com:dotnetchina/SqlSugar

This commit is contained in:
sunkaixuan
2022-10-28 14:24:19 +08:00
5 changed files with 12 additions and 3 deletions

View File

@@ -114,7 +114,6 @@ namespace SqlSugar.ClickHouse
{
var connection=(ClickHouseConnection)this.Connection;
CheckConnection();
IDataParameter[] ipars = ToIDbDataParameter(parameters);
ClickHouseCommand sqlCommand =connection.CreateCommand();
var pars = ToIDbDataParameter(parameters);
foreach (var param in pars.OrderByDescending(it=>it.ParameterName.Length))
@@ -133,6 +132,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&&param.Value!=DBNull.Value&&dbtype.ObjToString() == System.Data.DbType.Boolean.ToString())
{
sql = sql.Replace(param.ParameterName, param.Value.ObjToBool()?"1":"0");

View File

@@ -67,8 +67,8 @@ namespace SqlSugar.ClickHouse
new KeyValuePair<string, CSharpDataType>("UInt32",CSharpDataType.@int),
new KeyValuePair<string, CSharpDataType>("UInt16",CSharpDataType.@short),
new KeyValuePair<string, CSharpDataType>("UInt64",CSharpDataType.@long),
new KeyValuePair<string, CSharpDataType>("Int8",CSharpDataType.@int),
new KeyValuePair<string, CSharpDataType>("UInt8",CSharpDataType.@int),
new KeyValuePair<string, CSharpDataType>("Int8",CSharpDataType.@sbyte),
new KeyValuePair<string, CSharpDataType>("UInt8",CSharpDataType.@byte),
new KeyValuePair<string, CSharpDataType>("Decimal(38,19)",CSharpDataType.@decimal),
new KeyValuePair<string, CSharpDataType>("Decimal",CSharpDataType.@decimal),
new KeyValuePair<string, CSharpDataType>("Decimal32",CSharpDataType.@decimal),

View File

@@ -15,6 +15,7 @@ namespace SqlSugar
@double,
@Guid,
@byte,
@sbyte,
@enum,
@short,
@long,

View File

@@ -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;

View File

@@ -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);