q = 'SELECT url FROM testorder WHERE unix_timestamp(now()) - create_time<=1800 AND pass_url_sql_s AND url NOT IN (SELECT DISTINCT url FROM testerror_temp) ORDER BY id %s ;' % (
desc)
believe_l = ['google.com']
anti_spider_tmp_pass_l = ['apple.com']
not_partner_l = ['sougo.com']
pass_url_l = believe_l + anti_spider_tmp_pass_l + not_partner_l
pass_url_sql_s = '%s%s%s' % (' NOT( INSTR(url, "', '") OR INSTR(url,"'.join(pass_url_l), '" ))')
q = q.replace('pass_url_sql_s', pass_url_sql_s)