|
|
@ -29,11 +29,11 @@ public class AttendanceService { |
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getAbstractCounts() { |
|
|
public List<Map<String, Object>> getAbstractCounts() { |
|
|
String sql = "SELECT emp_type, COUNT(enrollment_id) AS totalCount, " |
|
|
String sql = "SELECT emp_type, COUNT(enrollment_id) AS totalCount, " |
|
|
+ "SUM(CASE WHEN facial_attendance = 1 THEN 1 ELSE 0 END) AS facialRegistered, " |
|
|
|
|
|
+ "SUM(CASE WHEN facial_attendance = 0 THEN 1 ELSE 0 END) AS facialNotRegistered " |
|
|
|
|
|
+ "FROM enrollment_table " |
|
|
|
|
|
+ "WHERE isactive = 1 AND isdelete = 0 AND zone != 0 " |
|
|
|
|
|
+ "GROUP BY emp_type"; |
|
|
|
|
|
|
|
|
+ "SUM(CASE WHEN facial_attendance = 1 THEN 1 ELSE 0 END) AS facialRegistered, " |
|
|
|
|
|
+ "SUM(CASE WHEN facial_attendance = 0 THEN 1 ELSE 0 END) AS facialNotRegistered " |
|
|
|
|
|
+ "FROM enrollment_table " |
|
|
|
|
|
+ "WHERE isactive = 1 AND isdelete = 0 AND zone != 0 and emp_type ='Park' " |
|
|
|
|
|
+ "GROUP BY emp_type"; |
|
|
|
|
|
|
|
|
return jdbcTemplate.queryForList(sql); |
|
|
return jdbcTemplate.queryForList(sql); |
|
|
} |
|
|
} |
|
|
@ -81,10 +81,12 @@ public class AttendanceService { |
|
|
+ "GROUP BY et.zone, fd.facialRegistered, fd.facialNotRegistered " |
|
|
+ "GROUP BY et.zone, fd.facialRegistered, fd.facialNotRegistered " |
|
|
+ "ORDER BY et.zone"; |
|
|
+ "ORDER BY et.zone"; |
|
|
|
|
|
|
|
|
return jdbcTemplate.queryForList(sql, new Object[] { empType, fromDateTime, toDateTime, fromDateTime, toDateTime, fromDateTime, toDateTime, empType }); |
|
|
|
|
|
|
|
|
return jdbcTemplate.queryForList(sql, new Object[] { empType, fromDateTime, toDateTime, fromDateTime, |
|
|
|
|
|
toDateTime, fromDateTime, toDateTime, empType }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getDetailedList(String empType, String category, String fromDateStr, String toDateStr, Integer zone, String parkName) { |
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getDetailedList(String empType, String category, String fromDateStr, |
|
|
|
|
|
String toDateStr, Integer zone, String parkName) { |
|
|
LocalDate fromDate; |
|
|
LocalDate fromDate; |
|
|
LocalDate toDate; |
|
|
LocalDate toDate; |
|
|
|
|
|
|
|
|
@ -120,11 +122,11 @@ public class AttendanceService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String sql = "SELECT et.enrollment_id, et.name, et.designation, et.department, et.incharge_name, et.incharge_phoneno, et.emp_id, et.park_name, " |
|
|
String sql = "SELECT et.enrollment_id, et.name, et.designation, et.department, et.incharge_name, et.incharge_phoneno, et.emp_id, et.park_name, " |
|
|
+ "ifnull(att.appversion,'') as appversion, ifnull(att.apptype,'')as apptype, ifnull(att.location,'') as location, " |
|
|
|
|
|
+ "DATE_FORMAT(att.indatetime, '%d-%m-%Y %h:%i %p') as intime, att.inphoto as inphoto, att.inby, " |
|
|
|
|
|
+ "DATE_FORMAT(att.outdatetime, '%d-%m-%Y %h:%i %p') as outtime, att.outphoto as outphoto, att.outby, " |
|
|
|
|
|
+ "DATE_FORMAT(att.oddatetime, '%d-%m-%Y %h:%i %p') as odtime, att.odby, et.zone, " |
|
|
|
|
|
+ "DATE_FORMAT(att.leavedatetime, '%d-%m-%Y %h:%i %p') as leavedatetime, att.leaveby " |
|
|
|
|
|
|
|
|
+ "ifnull(att.appversion,'') as appversion, ifnull(att.apptype,'')as apptype, ifnull(att.location,'') as location, " |
|
|
|
|
|
+ "DATE_FORMAT(att.indatetime, '%d-%m-%Y %h:%i %p') as intime, att.inphoto as inphoto, att.inby, " |
|
|
|
|
|
+ "DATE_FORMAT(att.outdatetime, '%d-%m-%Y %h:%i %p') as outtime, att.outphoto as outphoto, att.outby, " |
|
|
|
|
|
+ "DATE_FORMAT(att.oddatetime, '%d-%m-%Y %h:%i %p') as odtime, att.odby, et.zone, " |
|
|
|
|
|
+ "DATE_FORMAT(att.leavedatetime, '%d-%m-%Y %h:%i %p') as leavedatetime, att.leaveby " |
|
|
+ "FROM enrollment_table et " |
|
|
+ "FROM enrollment_table et " |
|
|
+ "inner join attendance att on et.enrollment_id = att.enrollment_id " |
|
|
+ "inner join attendance att on et.enrollment_id = att.enrollment_id " |
|
|
+ " and " + filterDateColumn + " >= ? and " + filterDateColumn + " <= ? " |
|
|
+ " and " + filterDateColumn + " >= ? and " + filterDateColumn + " <= ? " |
|
|
@ -148,7 +150,8 @@ public class AttendanceService { |
|
|
|
|
|
|
|
|
sql += " order by " + dateColumn + " desc "; |
|
|
sql += " order by " + dateColumn + " desc "; |
|
|
|
|
|
|
|
|
System.out.println("EmpType: " + empType + ", Category: " + category + ", From: " + fromDateTime + ", To: " + toDateTime + ", Zone: " + zone + ", ParkName: " + parkName); |
|
|
|
|
|
|
|
|
System.out.println("EmpType: " + empType + ", Category: " + category + ", From: " + fromDateTime + ", To: " |
|
|
|
|
|
+ toDateTime + ", Zone: " + zone + ", ParkName: " + parkName); |
|
|
return jdbcTemplate.queryForList(sql, params.toArray()); |
|
|
return jdbcTemplate.queryForList(sql, params.toArray()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -167,7 +170,7 @@ public class AttendanceService { |
|
|
} else { |
|
|
} else { |
|
|
toDate = LocalDate.parse(toDateStr, INPUT_FORMAT); |
|
|
toDate = LocalDate.parse(toDateStr, INPUT_FORMAT); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String fromDateTime = fromDate + " 00:00:00"; |
|
|
String fromDateTime = fromDate + " 00:00:00"; |
|
|
String toDateTime = toDate + " 23:59:59"; |
|
|
String toDateTime = toDate + " 23:59:59"; |
|
|
|
|
|
|
|
|
@ -193,7 +196,7 @@ public class AttendanceService { |
|
|
+ "GROUP BY et.park_name, fd.facialRegistered, fd.facialNotRegistered " |
|
|
+ "GROUP BY et.park_name, fd.facialRegistered, fd.facialNotRegistered " |
|
|
+ "ORDER BY et.park_name"; |
|
|
+ "ORDER BY et.park_name"; |
|
|
|
|
|
|
|
|
return jdbcTemplate.queryForList(sql, new Object[] { zone, fromDateTime, toDateTime, fromDateTime, toDateTime, fromDateTime, toDateTime, zone }); |
|
|
|
|
|
|
|
|
return jdbcTemplate.queryForList(sql, new Object[] { zone, fromDateTime, toDateTime, fromDateTime, toDateTime, |
|
|
|
|
|
fromDateTime, toDateTime, zone }); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|