|
@ -273,6 +273,7 @@ namespace SqlSugar |
|
|
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'"; |
|
|
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int GetDbColumnIndex = 0; |
|
|
public virtual string GetDbColumn(DbColumnInfo columnInfo ,object name) |
|
|
public virtual string GetDbColumn(DbColumnInfo columnInfo ,object name) |
|
|
{ |
|
|
{ |
|
|
if (columnInfo.InsertServerTime) |
|
|
if (columnInfo.InsertServerTime) |
|
@ -283,6 +284,14 @@ namespace SqlSugar |
|
|
{ |
|
|
{ |
|
|
return columnInfo.InsertSql; |
|
|
return columnInfo.InsertSql; |
|
|
} |
|
|
} |
|
|
|
|
|
else if (columnInfo.PropertyType.Name == "TimeOnly" && name!=null&&!name.ObjToString().StartsWith(Builder.SqlParameterKeyWord)) |
|
|
|
|
|
{ |
|
|
|
|
|
var timeSpan = UtilMethods.TimeOnlyToTimeSpan(columnInfo.Value); |
|
|
|
|
|
var pname =Builder.SqlParameterKeyWord+columnInfo.DbColumnName+ "_ts"+ GetDbColumnIndex; |
|
|
|
|
|
this.Parameters.Add(new SugarParameter(pname, timeSpan)); |
|
|
|
|
|
GetDbColumnIndex++; |
|
|
|
|
|
return pname; |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
return name+""; |
|
|
return name+""; |
|
|