Beispiel #1
0
 public void AddAndCondition(DmlfConditionBase cond)
 {
     if (cond == null)
     {
         return;
     }
     if (Where == null)
     {
         Where = new DmlfWhere();
     }
     if (Where.Condition != null)
     {
         if (Where.Condition is DmlfAndCondition)
         {
             ((DmlfAndCondition)Where.Condition).Conditions.Add(cond);
         }
         else
         {
             var and = new DmlfAndCondition();
             and.Conditions.Add(Where.Condition);
             and.Conditions.Add(cond);
             Where.Condition = and;
         }
     }
     else
     {
         Where.Condition = cond;
     }
 }
        public void CompileFilter()
        {
            if (!Filters.Any()) return;

            var type = DetectFilterType(FilterType, DbshColumns);

            var entity = Entities.First();
            var expr = new DmlfColumnRefExpression
            {
                Column = new DmlfColumnRef
                {
                    ColumnName = entity.GetColumnName(Alias),
                    Source = entity.QuerySource,
                }
            };

            var andCondition = new DmlfAndCondition();

            foreach (var filter in Filters)
            {
                var cond = FilterParser.ParseFilterExpression(type, expr, filter);
                andCondition.Conditions.Add(cond);
            }

            if (andCondition.Conditions.Count == 1)
            {
                FilterCondition = andCondition.Conditions[0];
            }
            else
            {
                FilterCondition = andCondition;
            }
        }
Beispiel #3
0
 public void AddAndCondition(DmlfConditionBase cond)
 {
     if (cond == null) return;
     if (Where == null) Where = new DmlfWhere();
     if (Where.Condition != null)
     {
         if (Where.Condition is DmlfAndCondition)
         {
             ((DmlfAndCondition)Where.Condition).Conditions.Add(cond);
         }
         else
         {
             var and = new DmlfAndCondition();
             and.Conditions.Add(Where.Condition);
             and.Conditions.Add(cond);
             Where.Condition = and;
         }
     }
     else
     {
         Where.Condition = cond;
     }
 }
Beispiel #4
0
 public virtual void GenSqlItem(DmlfConditionBase item, ISqlDumper dmp)
 {
     item.GenSql(dmp);
 }
Beispiel #5
0
 public virtual void GenSqlItem(DmlfConditionBase item, ISqlDumper dmp)
 {
     item.GenSql(dmp);
 }