mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
修改ClickHouse数据类型错误
This commit is contained in:
@ -201,7 +201,10 @@ namespace FreeSql.ClickHouse
|
||||
return null;
|
||||
}
|
||||
var left = ExpressionLambdaToSql(exp.Expression, tsc);
|
||||
|
||||
if ((exp.Expression as MemberExpression)?.Expression.NodeType == ExpressionType.Constant)
|
||||
left = $"toDateTime({left})";
|
||||
|
||||
//IsDate(left);
|
||||
switch (exp.Member.Name)
|
||||
{
|
||||
case "Date": return $"toDate({left})";
|
||||
@ -219,6 +222,19 @@ namespace FreeSql.ClickHouse
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public bool IsInt(string _string)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_string))
|
||||
return false;
|
||||
int i = 0;
|
||||
return int.TryParse(_string, out i);
|
||||
}
|
||||
public bool IsDate(string date)
|
||||
{
|
||||
if (string.IsNullOrEmpty(date))
|
||||
return true;
|
||||
return DateTime.TryParse(date, out var time);
|
||||
}
|
||||
public override string ExpressionLambdaToSqlMemberAccessTimeSpan(MemberExpression exp, ExpTSC tsc)
|
||||
{
|
||||
if (exp.Expression == null)
|
||||
|
Reference in New Issue
Block a user