Update core

This commit is contained in:
sunkaixuna 2022-01-22 13:56:42 +08:00
parent cf611f6d0b
commit 6cf498b767
2 changed files with 7 additions and 3 deletions

View File

@ -102,7 +102,7 @@ namespace SqlSugar
new KeyValuePair<string, CSharpDataType>("number",CSharpDataType.Single),
new KeyValuePair<string, CSharpDataType>("decimal",CSharpDataType.@decimal),
new KeyValuePair<string, CSharpDataType>("decimal",CSharpDataType.Single),
new KeyValuePair<string, CSharpDataType>("dec",CSharpDataType.@decimal),
new KeyValuePair<string, SqlSugar.CSharpDataType>("double precision",CSharpDataType.@double),
new KeyValuePair<string, SqlSugar.CSharpDataType>("binary", CSharpDataType.@byteArray),

View File

@ -164,14 +164,18 @@ namespace SqlSugar
{
colum = table.Columns[i];
if (i != 0) sb.Append(",");
if (colum.DataType == typeof(string) &&( row[colum].ToString().Contains(",") || row[colum].ToString().Contains("\r")||row[colum].ToString().Contains("\"")))
if (colum.DataType == typeof(string) && (row[colum].ToString().Contains(",") || row[colum].ToString().Contains("\r") || row[colum].ToString().Contains("\"")))
{
sb.Append("\"" + row[colum].ToString().Replace("\"", "\"\"") + "\"");
}
else if (colum.DataType == typeof(bool))
else if (colum.DataType == typeof(bool))
{
sb.Append(row[colum].ObjToBool() ? 1 : 0);
}
else if (colum.DataType == UtilConstants.DateType&& row[colum] != null && row[colum] != DBNull.Value)
{
sb.Append(row[colum].ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff"));
}
else sb.Append(row[colum].ToString());
}
sb.AppendLine();