Commit f37d5a66 authored by Quxl's avatar Quxl

x

parent 1c44a2ec
......@@ -24,7 +24,7 @@ public class LogServiceImpl implements LogService {
@Override
public List<Map<String, Object>> queryLogList(String type, String username, Page page) {
SqlWhere where = new SqlWhere().eq("t.type", type).eq("t.username", username);
String sql = "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'";
String sql = "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' or l.type = 'user') left join fc_member m on m.id = l.loginid and (l.type = 'MEMBER' or l.type = 'member') left join fc_admin a on a.adminid = l.loginid and (l.type = 'ADMIN' or l.type = 'admin')";
sql = "select t.* from (" + sql + ") t" + StringUtil.join(" and ", " where ", "", "", where.getStringList()) + " order by t.create_time desc";
return jdbcTemplate.limit(sql, page, where.getObjectArray());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment