Commit ac7690fc authored by Quxl's avatar Quxl

x

parent b8190ec8
...@@ -23,7 +23,7 @@ public class LogServiceImpl implements LogService { ...@@ -23,7 +23,7 @@ public class LogServiceImpl implements LogService {
@Override @Override
public List<Map<String, Object>> queryLogList(String type, String username, Page page) { public List<Map<String, Object>> queryLogList(String type, String username, Page page) {
SqlWhere where = new SqlWhere().eq("t.type", type).eq("t.username", username); SqlWhere where = new SqlWhere().eq("t.type", type.toLowerCase()).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' 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()) + " order by t.create_time desc"; 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()); 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