Stringsql="select l.*, le.ext, ifnull(ifnull(u.username, m.username), a.realname) username from fc_logs l left join fc_logs_ext le on le.path = l.path left join fc_user u on u.uid = l.loginid and l.type = 'USER' left join fc_member m on m.id = l.loginid and l.type = 'MEMBER' left join fc_admin a on a.adminid = l.loginid and l.type = 'ADMIN'";
sql="select t.* from ("+sql+") t"+StringUtil.join(" and "," where ","","",where.getStringList());
sql="select t.* from ("+sql+") t"+StringUtil.join(" and "," where ","","",where.getStringList())+" order by t.create_time desc";