This commit is contained in:
sunkaixuan
2017-11-06 17:18:03 +08:00
parent 0f4f95803f
commit c97660d7ef
6 changed files with 32 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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