mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update exp to sql
This commit is contained in:
parent
16cdf5ee70
commit
00f07632fd
@ -19,6 +19,14 @@ namespace OrmTest
|
||||
db.CodeFirst.InitTables<Unitadfaint21>();
|
||||
db.Insertable(new Unitadfaint21() { id = 1 , id2=22 }).ExecuteCommand();
|
||||
var list2 = db.Queryable<Unitadfaint21>().ToList();
|
||||
|
||||
var list3=db.Queryable<Order>()
|
||||
// .Where(it=>SqlFunc.ToString(it.Id>0?1:0)=="")
|
||||
.Select(it => new
|
||||
{
|
||||
count = SqlFunc.AggregateSum(it.Id < 20 ? 1 : 0)
|
||||
//count = SqlFunc.AggregateSum(SqlFunc.IIF(b.客户确认状态 < 20, 1, 0))
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
public class Unitadfaint21
|
||||
|
@ -547,6 +547,10 @@ namespace SqlSugar
|
||||
{
|
||||
parameter.CommonTempData = DateTime.Now.Date;
|
||||
}
|
||||
else if (item is ConditionalExpression)
|
||||
{
|
||||
parameter.CommonTempData = GetNewExpressionValue(item);
|
||||
}
|
||||
else if (IsDateDate(item))
|
||||
{
|
||||
parameter.CommonTempData = GetNewExpressionValue(item);
|
||||
@ -585,7 +589,7 @@ namespace SqlSugar
|
||||
methodCallExpressionArgs.IsMember = false;
|
||||
}
|
||||
}
|
||||
if (IsDateDate(item) || IsDateValue(item)|| IsDateItemValue(item))
|
||||
if (IsDateDate(item) || IsDateValue(item)|| IsDateItemValue(item)||item is ConditionalExpression)
|
||||
{
|
||||
methodCallExpressionArgs.IsMember = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user