| | |
| | | import cn.com.basic.face.discern.entity.Visit;
|
| | | import cn.com.basic.face.discern.entity.VisitDetail;
|
| | | import cn.com.basic.face.discern.query.item.CheckInQueryItem;
|
| | |
|
| | | import cn.com.basic.face.discern.query.item.OfflineVisitItem;
|
| | |
|
| | |
|
| | | public class CheckInDao extends BaseDao{
|
| | |
| | |
|
| | | /**
|
| | | * 添加访客记录
|
| | | * @param params
|
| | | */
|
| | | public void add(RequestParams params) {
|
| | | params.getStringParameter(Visit.FieldNames.visitReasonId);
|
| | | params.getStringParameter(Visit.FieldNames.visitReason);
|
| | | params.getStringParameter(Visit.FieldNames.remark);
|
| | | params.getStringParameter(Visit.FieldNames.visitorId);
|
| | | params.getStringParameter(Visit.FieldNames.visiteeId);
|
| | | params.getStringParameter(Visit.FieldNames.visitorCompanyId);
|
| | | params.getStringParameter(Visit.FieldNames.visiteeCompanyId);
|
| | | params.getStringParameter(Visit.FieldNames.enterTime);
|
| | | params.getStringParameter(Visit.FieldNames.currentStateId);
|
| | | params.getStringParameter(Visit.FieldNames.warning);
|
| | | params.getStringParameter(VisitDetail.FieldNames.stateId);
|
| | | params.getStringParameter(VisitDetail.FieldNames.createTime);
|
| | | params.getStringParameter(VisitDetail.FieldNames.deviceId);
|
| | | public void add(OfflineVisitItem entity) {
|
| | | String sql =
|
| | | "INSERT INTO visit (\n" +
|
| | | " visit_id,\n" +
|
| | | " visit_reason_id,\n" +
|
| | | " remark,\n" +
|
| | | " enter_time,\n" +
|
| | | " exit_time,\n" +
|
| | | " visitor_type_id,\n" +
|
| | | " visitor_id,\n" +
|
| | | " visitor_company_id,\n" +
|
| | | " visitee_id,\n" +
|
| | | " visitee_company_id,\n" +
|
| | | " current_state_id,\n" +
|
| | | " warning,\n" +
|
| | | " update_time,\n" +
|
| | | " is_synchron,\n" +
|
| | | " device_company_id\n" +
|
| | | ")\n" +
|
| | | "VALUES\n" +
|
| | | " (\n" +
|
| | | " '"+entity.getVisitId()+"', "+
|
| | | " '"+entity.getVisitReasonId()+"', "+
|
| | | " '"+entity.getRemark()+"', "+
|
| | | " '"+entity.getEnterTime()+"', "+
|
| | | " '"+entity.getExitTime()+"', "+
|
| | | " '"+entity.getVisitorTypeId()+"', "+
|
| | | " '"+entity.getVisitorId()+"', "+
|
| | | " '"+entity.getVisitorCompanyId()+"', "+
|
| | | " '"+entity.getVisiteeId()+"', "+
|
| | | " '"+entity.getVisiteeCompanyId()+"', "+
|
| | | " '"+entity.getCurrentStateId()+"', "+
|
| | | " '"+entity.getWarning()+"', "+
|
| | | " '"+entity.getUpdateTime()+"', "+
|
| | | " '"+entity.getIsSynchron()+"', "+
|
| | | " '"+entity.getDeviceCompanyId()+"' "+
|
| | | " )";
|
| | | MainActivity.getInstance().db.execSQL(sql);
|
| | | }
|
| | |
|
| | | public boolean hasOfflineCheckInData() {
|
| | | Cursor c = Config.sqlMap.getDb().rawQuery("select count(*) from visit", new String[]{});
|
| | | Cursor c = MainActivity.getInstance().db.rawQuery("select count(*) from visit", new String[]{});
|
| | | c.moveToFirst();
|
| | | return c.getInt(0) > 0 ? true : false;
|
| | | }
|