Example #1
0
        /// <summary>
        /// 值等于一段子查询返回的值的条件解析,子查询返回的必须是单值
        /// </summary>
        /// <param name="condition">需要解析的条件对象</param>
        /// <returns>返回解析后的条件字符串</returns>
        protected override string SQLEqualParse(SQLEqualCondition condition)
        {
            StringBuilder conditionStr = new StringBuilder(" ");
            string        queryColName = condition.SearchColumn.CurrentSearcher.TableName + "." + condition.SearchColumn.ColumnName;

            if (string.IsNullOrEmpty(condition.SearchColumn.ConditionString))
            {
                conditionStr.Append(queryColName);
            }
            else
            {
                conditionStr.Append(condition.SearchColumn.ConditionString.Replace(SQLPlaceholder.ColName, queryColName));
            }

            conditionStr.Append(" = (");
            conditionStr.Append(condition.SQL);
            conditionStr.Append(") ");

            return(conditionStr.ToString());
        }
Example #2
0
        /// <summary>
        /// 值等于一段子查询返回的值的条件解析,子查询返回的必须是单值
        /// </summary>
        /// <param name="condition">需要解析的条件对象</param>
        /// <returns>返回解析后的条件字符串</returns>
        protected override string SQLEqualParse(SQLEqualCondition condition)
        {
            StringBuilder conditionStr = new StringBuilder(" ");
            string queryColName = condition.SearchColumn.CurrentSearcher.TableName + "." + condition.SearchColumn.ColumnName;

            if (string.IsNullOrEmpty(condition.SearchColumn.ConditionString))
            {
                conditionStr.Append(queryColName);
            }
            else
            {
                conditionStr.Append(condition.SearchColumn.ConditionString.Replace(SQLPlaceholder.ColName, queryColName));
            }

            conditionStr.Append(" = (");
            conditionStr.Append(condition.SQL);
            conditionStr.Append(") ");

            return conditionStr.ToString();
        }
Example #3
0
 /// <summary>
 /// 子查询等于条件
 /// </summary>
 /// <param name="relation">条件关系</param>
 /// <param name="column">查询字段对象</param>
 /// <param name="sql">子查询SQL</param>
 /// <returns>返回子查询等于条件对象</returns>
 public static SQLEqualCondition SQLEqual(ConditionRelation relation, SearchColumn column, string sql)
 {
     SQLEqualCondition cond = new SQLEqualCondition(relation, column, sql);
     return cond;
 }
Example #4
0
 /// <summary>
 /// 子查询等于条件
 /// </summary>
 /// <param name="column">查询字段对象</param>
 /// <param name="sql">子查询SQL</param>
 /// <returns>返回子查询等于条件对象</returns>
 public static SQLEqualCondition SQLEqual(SearchColumn column, string sql)
 {
     SQLEqualCondition cond = new SQLEqualCondition(column, sql);
     return cond;
 }
Example #5
0
 /// <summary>
 /// 子查询等于条件
 /// </summary>
 /// <param name="sql">子查询SQL</param>
 /// <returns>返回子查询等于条件对象</returns>
 public static SQLEqualCondition SQLEqual(string sql)
 {
     SQLEqualCondition cond = new SQLEqualCondition(sql);
     return cond;
 }
Example #6
0
        /// <summary>
        /// 子查询等于条件
        /// </summary>
        /// <param name="relation">条件关系</param>
        /// <param name="column">查询字段对象</param>
        /// <param name="sql">子查询SQL</param>
        /// <returns>返回子查询等于条件对象</returns>
        public static SQLEqualCondition SQLEqual(ConditionRelation relation, SearchColumn column, string sql)
        {
            SQLEqualCondition cond = new SQLEqualCondition(relation, column, sql);

            return(cond);
        }
Example #7
0
        /// <summary>
        /// 子查询等于条件
        /// </summary>
        /// <param name="sql">子查询SQL</param>
        /// <returns>返回子查询等于条件对象</returns>
        public static SQLEqualCondition SQLEqual(string sql)
        {
            SQLEqualCondition cond = new SQLEqualCondition(sql);

            return(cond);
        }