'Convert filters sent as dict, lists to SQL conditions. filter\'s key
is passed by map function, build conditions like:
* ifnull(`fieldname`, default_value) = %(fieldname)s
* `fieldname` [=, !=, >, >=, <, <=] %(fieldname)s'

def build_conditions(self, filters):

    conditions = []
    values = {}
    def _build_condition(key):
        u"\n DCTB  DCTB  DCTB  DCTB filter's    key    is    passed    by    map    function\n DCTB  DCTB  DCTB  DCTB build    conditions    like:\n DCTB  DCTB  DCTB  DCTB  DCTB *    ifnull(`fieldname`,    default_value)    =    %(fieldname)s\n DCTB  DCTB  DCTB  DCTB  DCTB *    `fieldname`    [=,    !=,    >,    >=,    <,    <=]    %(fieldname)s\n DCTB  DCTB  DCTB "
        _operator = u'='
        _rhs = ((u'    %(' + key) + u')s')
        value = filters.get(key)
        values[key] = value
        if isinstance(value, (list, tuple)):
            _operator = value[0]
            values[key] = value[1]
            if isinstance(value[1], (tuple, list)):
                inner_list = []
                for (i, v) in enumerate(value[1]):
                    inner_key = u'{0}_{1}'.format(key, i)
                    values[inner_key] = v
                    inner_list.append(u'%({0})s'.format(inner_key))
                _rhs = u'    ({0})'.format(u',    '.join(inner_list))
                del values[key]
        if (_operator not in [u'=', u'!=', u'>', u'>=', u'<', u'<=', u'like', u'in', u'not    in', u'not    like']):
            _operator = u'='
        if (u'[' in key):
            split_key = key.split(u'[')
            condition = ((((((u'ifnull(`' + split_key[0]) + u'`,    ') + split_key[1][:(-1)]) + u')    ') + _operator) + _rhs)
        else:
            condition = ((((u'`' + key) + u'`    ') + _operator) + _rhs)
        conditions.append(condition)
    if isinstance(filters, basestring):
        filters = {u'name': filters}
    for f in filters:
        _build_condition(f)
    return (u'    and    '.join(conditions), values)
