From ec544e9cc330ce40aeb78e96aa362e245feecd4d Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期五, 21 七月 2017 15:03:34 +0800
Subject: [PATCH] 

---
 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/AttendanceDao.java |   31 +++----------------------------
 1 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/AttendanceDao.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/AttendanceDao.java
index 3aee6e8..981826b 100644
--- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/AttendanceDao.java
+++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/AttendanceDao.java
@@ -16,7 +16,7 @@
 /**
  * 鑰冨嫟璁板綍
  */
-public class AttendanceDao {
+public class AttendanceDao extends BaseDao{
 
     public static AttendanceDao instance = new AttendanceDao();
 
@@ -50,7 +50,6 @@
                     .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 ");
@@ -81,7 +80,7 @@
             }
             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);
@@ -139,7 +138,7 @@
             }
             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();
@@ -152,29 +151,5 @@
         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;
-    }
 
 }

--
Gitblit v1.8.0