'value_name could be a string, or a tuple of strings
order by is represented as order_by
group by is represented as group_by'

def getAll(self, table_name, value_name, where=None, group_by=None, having=None, order_by=None, limit=None, offset=None, conj=u'AND', **kw):

    if isinstance(value_name, tuple):
        value_names = u','.join(value_name)
    elif isinstance(value_name, list):
        value_names = u','.join(value_name)
    else:
        value_names = value_name
    if isinstance(table_name, tuple):
        table_names = u','.join(table_name)
    elif isinstance(table_name, list):
        table_names = u','.join(table_name)
    else:
        table_names = table_name
    sql = (u'SELECT    %s    FROM    %s' % (value_names, table_names))
    if (where or kw):
        sql += u'    WHERE    '
    if where:
        sql += where
        if kw:
            sql += (u'    %s    ' % conj)
    if kw:
        arg = []
        for (k, v) in kw.iteritems():
            if isinstance(v, tuple):
                operator = v[0]
                arg.append(v[1])
            else:
                operator = u'='
                arg.append(v)
            sql += (u'    %s    %s    ?' % (k, operator))
            sql += conj
        sql = sql[:(- len(conj))]
    else:
        arg = None
    if (group_by is not None):
        sql += (u'    GROUP    BY    ' + group_by)
    if (having is not None):
        sql += (u'    HAVING    ' + having)
    if (order_by is not None):
        sql += (u'    ORDER    BY    ' + order_by)
    if (limit is not None):
        sql += (u'    LIMIT    %d' % limit)
    if (offset is not None):
        sql += (u'    OFFSET    %d' % offset)
    try:
        return (self.fetchall(sql, arg) or [])
    except Exception as msg:
        self._logger.exception(u'Wrong    getAll    sql    statement:    %s', sql)
        raise Exception(msg)
