namespace Infrastructure
{
///
/// 查询表达式中的最小单元,如:
/// new Filter {Key = "name", Value = "yubaolee", Contrast = "=="},
/// new Filter {Key = "name", Value = "yubaolee", Contrast = "contains"},
/// new Filter {Key = "age", Value = "10,20,30", Contrast = "in"},
/// new Filter {Key = "10,20,30", Value = "40", Contrast = "intersect"}
///
public class Filter
{
///
/// 过滤条件的关键字。
///
public string Key { get; set; }
///
/// 通常为值,如:yubaolee、10、10,20,30等。
///
public string Value { get; set; }
///
/// 通常为运算符,如:==、contains、in、intersect等。
///
public string Contrast { get; set; }
///
/// 对于特殊值的说明
///
public string Text { get; set; }
}
///
/// 查询对象类,用于封装查询条件。
///
public class QueryObject
{
///
/// 操作类型,定义了查询条件之间的逻辑关系,如OR、AND。
///
///
/// 该属性决定了如何组合多个过滤条件,以构建复杂的查询逻辑。
///
public string Operation { get; set; }
///
/// 过滤器数组,包含一组过滤条件。
///
public Filter[] Filters { get; set; }
///
/// 子查询对象数组,支持嵌套查询。
///
///
/// 通过嵌套查询对象,可以构建复杂的查询逻辑,处理更复杂的数据关系。
///
public QueryObject[] Children { get; set; }
}
}