- 增加 SqlExt.IsNull 方法;

This commit is contained in:
28810
2020-09-06 00:52:39 +08:00
parent 24e0fcd0af
commit 8200b0e2e0
4 changed files with 38 additions and 1 deletions

View File

@ -104,6 +104,19 @@ namespace FreeSql
public static ISqlOver<long> RowNumber() => Over<long>("row_number()");
#endregion
/// <summary>
/// isnull、ifnull、coalesce、nvl
/// </summary>
/// <typeparam name="TValue"></typeparam>
/// <param name="value"></param>
/// <param name="defaultValue"></param>
/// <returns></returns>
public static TValue IsNull<TValue>(TValue value, TValue defaultValue)
{
expContext.Value.Result = expContext.Value._commonExp._common.IsNull(expContext.Value.ParsedContent["value"], expContext.Value.ParsedContent["defaultValue"]);
return default(TValue);
}
/// <summary>
/// case when .. then .. end
/// </summary>
@ -311,7 +324,7 @@ namespace FreeSql
public interface IGroupConcat { }
#endregion
#region string.Join
#region string.Join
public static string StringJoinSqliteGroupConcat(object column, object delimiter)
{
expContext.Result = $"group_concat({expContext.ParsedContent["column"]},{expContext.ParsedContent["delimiter"]})";