mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update Insert time span
This commit is contained in:
parent
39f3cb9594
commit
1fe20fea04
@ -273,6 +273,7 @@ namespace SqlSugar
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
|
||||
private int GetDbColumnIndex = 0;
|
||||
public virtual string GetDbColumn(DbColumnInfo columnInfo ,object name)
|
||||
{
|
||||
if (columnInfo.InsertServerTime)
|
||||
@ -283,7 +284,15 @@ namespace SqlSugar
|
||||
{
|
||||
return columnInfo.InsertSql;
|
||||
}
|
||||
else
|
||||
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
|
||||
{
|
||||
return name+"";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user