mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
4.6
This commit is contained in:
@@ -166,6 +166,11 @@ namespace SqlSugar
|
||||
}
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
else if (type == UtilConstants.ByteArrayType)
|
||||
{
|
||||
string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value);
|
||||
return "N'" + bytesString + "'";
|
||||
}
|
||||
else if (type.IsEnum())
|
||||
{
|
||||
return Convert.ToInt64(value);
|
||||
|
@@ -175,7 +175,7 @@ namespace SqlSugar
|
||||
{
|
||||
updateTable.Append(SqlTemplateBatchUnion);
|
||||
}
|
||||
updateTable.Append("\r\n SELECT " + string.Join(",", columns.Select(it => string.Format(SqlTemplateBatchSelect, FormatValue(it.Value),Builder.GetTranslationColumnName(it.DbColumnName)))));
|
||||
updateTable.Append("\r\n SELECT " + string.Join(",", columns.Select(it => string.Format(SqlTemplateBatchSelect, FormatValue(it.Value), Builder.GetTranslationColumnName(it.DbColumnName)))));
|
||||
++i;
|
||||
}
|
||||
pageIndex++;
|
||||
@@ -210,7 +210,7 @@ namespace SqlSugar
|
||||
{
|
||||
if (SetValues.IsValuable())
|
||||
{
|
||||
var setValue = SetValues.Where(sv => it.IsPrimarykey == false && (it.IsIdentity == false || (IsOffIdentity && it.IsIdentity))).Where(sv => sv.Key == Builder.GetTranslationColumnName(it.DbColumnName)|| sv.Key==Builder.GetTranslationColumnName(it.PropertyName));
|
||||
var setValue = SetValues.Where(sv => it.IsPrimarykey == false && (it.IsIdentity == false || (IsOffIdentity && it.IsIdentity))).Where(sv => sv.Key == Builder.GetTranslationColumnName(it.DbColumnName) || sv.Key == Builder.GetTranslationColumnName(it.PropertyName));
|
||||
if (setValue != null && setValue.Any())
|
||||
{
|
||||
return setValue.First().Value;
|
||||
@@ -259,6 +259,11 @@ namespace SqlSugar
|
||||
}
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
else if (type == UtilConstants.ByteArrayType)
|
||||
{
|
||||
string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value);
|
||||
return "N'" + bytesString + "'";
|
||||
}
|
||||
else if (type.IsEnum())
|
||||
{
|
||||
return Convert.ToInt64(value);
|
||||
|
@@ -109,6 +109,11 @@ namespace SqlSugar
|
||||
{
|
||||
return Convert.ToInt64(value);
|
||||
}
|
||||
else if (type == UtilConstants.ByteArrayType)
|
||||
{
|
||||
string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value);
|
||||
return "N'" + bytesString + "'";
|
||||
}
|
||||
else if (type == UtilConstants.BoolType)
|
||||
{
|
||||
return value.ObjToBool() ? "1" : "0";
|
||||
|
@@ -58,6 +58,11 @@ namespace SqlSugar
|
||||
{
|
||||
return Convert.ToInt64(value);
|
||||
}
|
||||
else if (type == UtilConstants.ByteArrayType)
|
||||
{
|
||||
string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value);
|
||||
return "N'" + bytesString + "'";
|
||||
}
|
||||
else if (type == UtilConstants.BoolType)
|
||||
{
|
||||
return value.ObjToBool() ? "1" : "0";
|
||||
|
@@ -56,6 +56,11 @@ namespace SqlSugar
|
||||
{
|
||||
return Convert.ToInt64(value);
|
||||
}
|
||||
else if (type == UtilConstants.ByteArrayType)
|
||||
{
|
||||
string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value);
|
||||
return "N'" + bytesString + "'";
|
||||
}
|
||||
else if (type == UtilConstants.BoolType)
|
||||
{
|
||||
return value.ObjToBool() ? "1" : "0";
|
||||
|
@@ -54,6 +54,11 @@ namespace SqlSugar
|
||||
{
|
||||
return Convert.ToInt64(value);
|
||||
}
|
||||
else if (type == UtilConstants.ByteArrayType)
|
||||
{
|
||||
string bytesString = System.Text.Encoding.ASCII.GetString((byte[])value);
|
||||
return "N'" + bytesString + "'";
|
||||
}
|
||||
else if (type == UtilConstants.BoolType)
|
||||
{
|
||||
return value.ObjToBool() ? "1" : "0";
|
||||
|
Reference in New Issue
Block a user