| | |
| | | /**
|
| | | * 考勤记录
|
| | | */
|
| | | public class AttendanceDao {
|
| | | public class AttendanceDao extends BaseDao{
|
| | |
|
| | | public static AttendanceDao instance = new AttendanceDao();
|
| | |
|
| | |
| | | .append(" LEFT JOIN register b ON a.register_id = b.register_id ")
|
| | | .append(" LEFT JOIN dictionary d ON d.dict_id = b.gender_id ")
|
| | | .append(" LEFT JOIN post e ON e.post_id = b.post_id ")
|
| | | .append(" LEFT JOIN post e ON e.post_id = b.post_id ")
|
| | | .append(" LEFT JOIN department f ON f.dept_id = b.department_id ")
|
| | | .append(" WHERE ").append(" 1 = 1 ").append(" GROUP BY b.register_id ")
|
| | | .append(" ORDER BY b.username ");
|
| | |
| | | }
|
| | | Integer total = null;
|
| | | while (c_count.moveToNext()) {
|
| | | total = c.getInt(c.getColumnIndex("register_id"));
|
| | | total = c.getInt(c.getColumnIndex("count"));
|
| | | }
|
| | | resultBean.setTotalPages(getTotalPageSize(total));
|
| | | resultBean.setPageNum(pageNum);
|
| | |
| | | }
|
| | | Integer total = null;
|
| | | while (c_count.moveToNext()) {
|
| | | total = c.getInt(c.getColumnIndex("register_id"));
|
| | | total = c.getInt(c.getColumnIndex("count"));
|
| | | }
|
| | | c.close();
|
| | | c_count.close();
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取分页开始行
|
| | | * @param pageNum
|
| | | * @return
|
| | | */
|
| | | private int getStartIndex(Integer pageNum){
|
| | | if(pageNum == null || pageNum <= 0){
|
| | | return 0;
|
| | | }
|
| | | return (pageNum-1)*Integer.parseInt(CommonVariables.Page.DEFAULT_PAGE_SIZE);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取总页数
|
| | | * @param total
|
| | | * @return
|
| | | */
|
| | | private int getTotalPageSize(Integer total){
|
| | | if(total == null || total <= 0){
|
| | | return 1;
|
| | | }
|
| | | int pageSize = Integer.parseInt(CommonVariables.Page.DEFAULT_PAGE_SIZE);
|
| | | return total%pageSize == 0 ? total/pageSize : total/pageSize + 1;
|
| | | }
|
| | |
|
| | | }
|