mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-06 05:37:58 +08:00
Update mysql bulk copy
This commit is contained in:
parent
8469ccd21e
commit
2c014eccb0
@ -82,10 +82,10 @@ namespace SqlSugar
|
|||||||
var value = ValueConverter(column, PropertyCallAdapterProvider<T>.GetInstance(column.PropertyName).InvokeGet(item));
|
var value = ValueConverter(column, PropertyCallAdapterProvider<T>.GetInstance(column.PropertyName).InvokeGet(item));
|
||||||
if (isMySql && column.UnderType == UtilConstants.BoolType)
|
if (isMySql && column.UnderType == UtilConstants.BoolType)
|
||||||
{
|
{
|
||||||
if (value.ObjToBool() == false)
|
//if (value.ObjToBool() == false)
|
||||||
{
|
//{
|
||||||
value = DBNull.Value;
|
// value = DBNull.Value;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
else if (isSqliteCore&&column.UnderType == UtilConstants.StringType && value is bool)
|
else if (isSqliteCore&&column.UnderType == UtilConstants.StringType && value is bool)
|
||||||
{
|
{
|
||||||
@ -180,10 +180,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
if (column.DataType==UtilConstants.BoolType&&this.context.CurrentConnectionConfig.DbType.IsIn(DbType.MySql, DbType.MySqlConnector))
|
if (column.DataType==UtilConstants.BoolType&&this.context.CurrentConnectionConfig.DbType.IsIn(DbType.MySql, DbType.MySqlConnector))
|
||||||
{
|
{
|
||||||
if (Convert.ToBoolean(dr[column.ColumnName]) == false)
|
//if (Convert.ToBoolean(dr[column.ColumnName]) == false)
|
||||||
{
|
//{
|
||||||
dr[column.ColumnName] = DBNull.Value;
|
// dr[column.ColumnName] = DBNull.Value;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tempDataTable.Rows.Add(dr);
|
tempDataTable.Rows.Add(dr);
|
||||||
|
@ -170,7 +170,14 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else if (colum.DataType == typeof(bool))
|
else if (colum.DataType == typeof(bool))
|
||||||
{
|
{
|
||||||
sb.Append(row[colum].ObjToBool() ? 1 : 0);
|
if (row[colum]==null||row[colum] == DBNull.Value)
|
||||||
|
{
|
||||||
|
sb.Append("NULL");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sb.Append(row[colum].ObjToBool() ? 1 : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (colum.DataType == UtilConstants.DateType&& row[colum] != null && row[colum] != DBNull.Value)
|
else if (colum.DataType == UtilConstants.DateType&& row[colum] != null && row[colum] != DBNull.Value)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user