Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,17 @@ public static String getPersonHelperStatus(String person_id, String start_date,
}

public static String getAllStatus(String table, String start_date, String end_date) {
String[] columnNames = new String[]{"count", "firstname", "lastname"};
String sql = "select count(*) as count, p.firstname as firstname, p.lastname as lastname from "
String[] columnNames = new String[]{"count", "firstname", "lastname", "email"};
String sql = "select count(*) as count, p.firstname as firstname, p.lastname as lastname, p.email from "
+ table + " as i " + "join people as p on i.person_id = p.person_id where i.slug > \"" +
start_date + "\" group by i.person_id order by p.firstname";
logger.info(sql);
List<Object> counts = DBHandler.getInstance().query(sql, columnNames);
StringBuilder sb = new StringBuilder();
counts.forEach(record -> {
HashMap<String, Object> r = (HashMap<String, Object>) record;
sb.append(r.get("count") + "\t" + r.get("firstname") + "\t" + r.get("lastname") + "\n");
sb.append(r.get("count") + "\t" + r.get("firstname") + "\t" + r.get("lastname") + "\t" + r.get("email") +
"\n");
});
return sb.toString();

Expand Down
Loading