| | |
| | | import cn.com.basic.face.discern.common.CommonVariables;
|
| | | import cn.com.basic.face.discern.common.ResultBean;
|
| | | import cn.com.basic.face.discern.query.item.AttendanceQueryItem;
|
| | | import cn.com.basic.face.discern.query.item.VisitQueryItem;
|
| | |
|
| | | public class VisitDao extends BaseDao{
|
| | |
|
| | |
| | | StringBuilder count = new StringBuilder(sb.length());
|
| | | count.append("select count(*) as count from (").append(sb).append(" ) _table");
|
| | | sb.append(" LIMIT ").append(getStartIndex(pageNum)).append(",").append(CommonVariables.Page.DEFAULT_PAGE_SIZE);
|
| | | List<AttendanceQueryItem> list = new ArrayList<AttendanceQueryItem>();
|
| | | AttendanceQueryItem aqi = null;
|
| | | List<VisitQueryItem> list = new ArrayList<VisitQueryItem>();
|
| | | VisitQueryItem aqi = null;
|
| | | Cursor c = db.rawQuery(sb.toString(),new String[]{});
|
| | | Cursor c_count = db.rawQuery(count.toString(),new String[]{});
|
| | | while (c.moveToNext()) {
|
| | | aqi = new AttendanceQueryItem();
|
| | | aqi = new VisitQueryItem();
|
| | | aqi.setRegisterId(c.getString(c.getColumnIndex("register_id")));
|
| | | aqi.setUsername(c.getString(c.getColumnIndex("username")));
|
| | | aqi.setSurveillancePhoto(c.getString(c.getColumnIndex("surveillance_photo")));
|
| | |
| | | }
|
| | | Integer total = null;
|
| | | while (c_count.moveToNext()) {
|
| | | total = c.getInt(c.getColumnIndex("count"));
|
| | | total = c_count.getInt(0);
|
| | | }
|
| | | resultBean.setTotalPages(getTotalPageSize(total));
|
| | | resultBean.setPageNum(pageNum);
|