left join rb_education_activity b on a.ActivityId = b.Id where 1=1
");
if(query==null)
{
returnnewList<RB_Education_Consult_Extend>();
}
else
{
if(query.EnrollState>0)
{
if(query.EnrollState==1)
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Education_Consult_Extend.Status),(int)DateStateEnum.Normal);
}
elseif(query.EnrollState==2)
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Education_Consult_Extend.Status),(int)DateStateEnum.Delete);
}
}
else
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Education_Consult_Extend.Status),(int)DateStateEnum.Normal);
}
if(query.TenantId>0)
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Education_Consult_Extend.TenantId),query.TenantId);
}
if(query.OrderStatus>-1)
{
if(query.OrderStatus==1)
{
builder.AppendFormat(" AND (a.{0}=1 or a.{1}={2} ) ",nameof(RB_Education_Consult_Extend.OrderStatus),nameof(RB_Education_Consult_Extend.PaymentWay),(int)Common.Enum.Goods.OrderPaymentTypeEnum.OfflinePay);
}
else
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Education_Consult_Extend.OrderStatus),query.OrderStatus);
}
}
if(query.MallBaseId>0)
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Education_Consult_Extend.MallBaseId),query.MallBaseId);
}
if(!string.IsNullOrEmpty(query.LinkMan))
{
builder.AppendFormat(" AND a.{0} LIKE @Name ",nameof(RB_Education_Consult_Extend.LinkMan));