using System;
using System.Collections.Generic;
using System.Text;
namespace MyCode.Project.Infrastructure.Search
{
///
/// 查询信息实体类
///
public class SearchInfo
{
public SearchInfo() {}
///
/// 构造函数
///
/// 字段名称
/// 字段的值
/// 字段的Sql操作符号
public SearchInfo(string fieldName, object fieldValue, SqlOperator sqlOperator)
: this(fieldName, fieldValue, sqlOperator, false)
{ }
///
/// 构造函数
///
/// 字段名称
/// 字段的值
/// 字段的Sql操作符号
/// 如果字段为空或者Null则不作为查询条件
public SearchInfo(string fieldName, object fieldValue, SqlOperator sqlOperator, bool excludeIfEmpty)
{
this.fieldName = fieldName;
this.fieldValue = fieldValue;
this.sqlOperator = sqlOperator;
this.excludeIfEmpty = excludeIfEmpty;
}
private string fieldName;
private object fieldValue;
private SqlOperator sqlOperator;
private bool excludeIfEmpty = false;
///
/// 字段名称
///
public string FieldName
{
get { return fieldName; }
set { fieldName = value; }
}
///
/// 字段的值
///
public object FieldValue
{
get { return fieldValue; }
set { fieldValue = value; }
}
///
/// 字段的Sql操作符号
///
public SqlOperator SqlOperator
{
get { return sqlOperator; }
set { sqlOperator = value; }
}
///
/// 如果字段为空或者Null则不作为查询条件
///
public bool ExcludeIfEmpty
{
get { return excludeIfEmpty; }
set { excludeIfEmpty = value; }
}
}
}