Skip to content

Commit

Permalink
修复MySql UInt类型 导入BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
DotNetNext committed Oct 2, 2023
1 parent 2e165fb commit eb7f382
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,27 @@ public partial class CodeTableController : BaseController
private SortTypeInfo GetEntityType(List<CodeType> types, DbColumnInfo columnInfo, CodeTableController codeTableController,DbType dbtype)
{
var typeInfo = types.FirstOrDefault(y => y.DbType.Any(it => it.Name.Equals(columnInfo.DataType, StringComparison.OrdinalIgnoreCase)));
if(typeInfo == null && (columnInfo.DataType+"").ToLower()=="double")
if (typeInfo == null && (columnInfo.DataType + "").ToLower() == "double")
{
var type = types.First(it => it.Name == "decimal_18_4");
return new SortTypeInfo() { CodeType = type, DbTypeInfo = type.DbType[0] };
}
else if (typeInfo == null && columnInfo.DataType == "int unsigned")
{
var type = types.First(it => it.Name == "int");
return new SortTypeInfo() { CodeType = type, DbTypeInfo = type.DbType[0] };
}
else if (typeInfo == null)
{
var type = types.First(it => it.Name == "string100");
return new SortTypeInfo() { CodeType = type, DbTypeInfo = type.DbType[0] };
}
else if (columnInfo.DataType == "json")
else if (columnInfo.DataType == "json")
{
var type = types.First(it => it.Name.ToLower() == "string2000");
return new SortTypeInfo() { CodeType = type, DbTypeInfo = type.DbType[0] };
}
else if (columnInfo.DataType == "timestamp"&&dbtype!=DbType.SqlServer)
else if (columnInfo.DataType == "timestamp" && dbtype != DbType.SqlServer)
{
var type = types.First(it => it.Name.ToLower() == "datetime");
return new SortTypeInfo() { CodeType = type, DbTypeInfo = type.DbType[0] };
Expand Down

0 comments on commit eb7f382

Please sign in to comment.