Пример #1
0
        private QTableColumn <T> AddColumn <T>(string columnName, string fieldName, bool isPk, bool isAutoIncrement, bool resultColumn, string resultSql)
        {
            QTableColumn <T> column = new QTableColumn <T>();

            column._columnType      = Enums.ColumnType.Column;
            column._columnName      = columnName;
            column._isPrimaryKey    = isPk;
            column._isResultColumn  = resultColumn;
            column._resultSql       = resultSql;
            column._table           = this;
            column._isAutoIncrement = isAutoIncrement;
            _columns.Add(fieldName.ToLower(), column);
            return(column);
        }
Пример #2
0
        /// <summary>
        /// 添加列
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="columnName"></param>
        /// <param name="fieldName"></param>
        /// <param name="isPk"></param>
        /// <param name="isAutoIncrement"></param>
        /// <param name="resultColumn"></param>
        /// <param name="resultSql"></param>
        /// <returns></returns>
        protected QTableColumn <T> AddColumn <T>(string columnName, string fieldName, bool isPk, bool isAutoIncrement, bool resultColumn, string resultSql)
        {
            QTableColumn <T> column = new QTableColumn <T> {
                _columnType      = Enums.ColumnType.Column,
                _columnName      = columnName,
                _isPrimaryKey    = isPk,
                _isResultColumn  = resultColumn,
                _resultSql       = resultSql,
                _table           = this,
                _isAutoIncrement = isAutoIncrement
            };

            _columns.Add(fieldName.ToLower(), column);
            if (isPk)
            {
                _primaryKey = column;
            }
            return(column);
        }
Пример #3
0
 /// <summary>
 /// 累加到【Where】语句,连接使用【AND】
 /// </summary>
 /// <param name="column"></param>
 /// <returns></returns>
 public QTable <T> Where(QTableColumn <bool> column)
 {
     GetSqlBuilder().Where(column == true);
     return(this);
 }