select * from ( (select t.id,c,adv_id,adv_job_id,sort_order,fund_rmb from ( select t.id, count(j.id) c,max(a.sort_order) sort_order,a.id as adv_id,MAX(a.other_id) as adv_job_id,t.fund_int*o.other_ref_value as fund_rmb from company t left join jobs j on j.company = t.id and status=1 and overtime>=curdate() left join options o on o.option_group = 10367 and o.option_value = t.fund_type right join adv a on a.ref_id = t.id and a.type in (4,14) and a.status=2 and ifnull(a.overtime,curdate())>=curdate() where a.id is not null and t.id is not null and floor(t.trade/100)='1' group by t.id ) t) UNION ALL (select * from ( select t.id, count(j.id) c,0 as adv_id,'' as adv_job_id,99999 as sort_order,t.fund_int*o.other_ref_value as fund_rmb from company t left join jobs j on j.company = t.id and status=1 and overtime>=curdate() left join options o on o.option_group = 10367 and o.option_value = t.fund_type where j.id is not null and t.logo is not null and t.logo<>'' and floor(t.trade/100)='1' and t.id not in ( select t.id from company t right join adv a on a.ref_id = t.id and a.type in (4,14) and a.status=2 and ifnull(a.overtime,curdate())>=curdate() where a.id is not null and t.id is not null and floor(t.trade/100)='1' group by t.id ) group by t.id ) t where c>=1 ) ) t order by sort_order asc,fund_rmb desc,id asc limit 0,6排球比分直播网 新版188比分直播 甘肃天水麻将下载 上海百搭麻将游戏 十佳股票配资平台 天津休彩十一选五开 3d图谜总汇全图九 河南麻将官网 中国对韩国排球比分 新浪nba比分 短期理财平台 北京pk10 井上和香 番号 广西快乐双彩开奖结 国标麻将怎么打图解 球探比分网下载 新疆25选7