private void QueryByField(string fieldName, string op, object fieldValue) { var paramId = NextParamId(); var newCondition = string.Format("{0} {1} {2}", adapter.Field(fieldName), op, adapter.Parameter(paramId)); AddParameter(paramId, fieldValue); conditions.Add(newCondition); }
private string GetCondition(string tableName, string fieldName, string op, object fieldValue) { string paramId = this.GetParamId(fieldName); string key = _adapter.Field(tableName, fieldName); string value = _adapter.Parameter(paramId); this.AddParameter(value, fieldValue); return(string.Format("{0} {1} {2}", key, op, value)); }
private string GetCondition(string tableName, string fieldName, string op, object fieldValue) { string paramId = this.GetParamId(fieldName); string key = _adapter.Field(tableName, fieldName); string value = _adapter.Parameter(paramId); if (_parameterDic.ContainsKey(value)) { value = value + Guid.NewGuid().ToString("n"); } if (_isSubQuery) { key = _adapter.Field(JoinSubAliasTableName, fieldName); //value = JoinSubAliasTableName + value; } this.AddParameter(value, fieldValue); return(string.Format("{0} {1} {2}", key, op, value)); }