using JiShe.CollectBus.Common.Extensions;
using JiShe.CollectBus.Common.Helpers;
namespace JiShe.CollectBus.IoTDB.Options
{
///
/// 查询条件
///
public class QueryCondition
{
///
/// 字段
///
public string Field { get; set; }
///
/// 操作符,>,=,<
///
public string Operator { get; set; }
///
/// 是否数值,如果是数值,则进行数值比较,否则进行字符串比较
///
public bool IsNumber { get; set; } = false;
private object _rawValue;
///
/// 值
///
public object Value
{
get => ApplyValueConversion(_rawValue);
set => _rawValue = value;
}
///
/// 值转换
///
///
///
private object ApplyValueConversion(object rawValue)
{
string declaredTypeName = rawValue.GetType().Name;
Func