update exp to sql

This commit is contained in:
sunkaixuna 2022-01-08 11:40:30 +08:00
parent 1a25f9485c
commit e60137d606

View File

@ -926,6 +926,10 @@ namespace SqlSugar
{
return $"strftime('%Y-%m-%d', {value})";
}
else if (IsSqlite() && formatString == "yyyy-MM-dd HH:mm:ss")
{
return $"strftime('%Y-%m-%d %H:%i:%S', {value})";
}
else if (IsSqlite() && formatString == "yyyy-MM")
{
return $"strftime('%Y-%m', {value})";
@ -958,6 +962,10 @@ namespace SqlSugar
{
return $"DATE_FORMAT({value}, '%Y%m%d')";
}
else if (IsMySql() && formatString == "yyyy-MM-dd HH:mm:ss")
{
return $"DATE_FORMAT({value}, '%Y-%m-%d %H:%i:%S')";
}
else if (IsMySql() && formatString.Contains("%"))
{
return $"DATE_FORMAT({value}, '{formatString}')";