| | |
| | | package cn.com.basic.face.service.sqlite;
|
| | |
|
| | | import android.content.ContentValues;
|
| | | import android.database.Cursor;
|
| | | import android.database.CursorJoiner;
|
| | | import android.database.sqlite.SQLiteDatabase;
|
| | |
| | |
|
| | | /**
|
| | | * 离线存储访客登记信息
|
| | | * @param entity
|
| | | * @param item
|
| | | */
|
| | | public void addOfflineVisit(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()+"', "+
|
| | | " 'N', "+
|
| | | " '"+entity.getDeviceCompanyId()+"' "+
|
| | | " )";
|
| | | MainActivity.getInstance().db.execSQL(sql);
|
| | | public long addOfflineVisit(OfflineVisitItem item) {
|
| | | ContentValues contentValues = new ContentValues();
|
| | | contentValues.put("visit_id",item.getVisitId());
|
| | | contentValues.put("visit_reason_id",item.getVisitReasonId());
|
| | | contentValues.put("remark",item.getRemark());
|
| | | contentValues.put("enter_time",item.getEnterTime());
|
| | | contentValues.put("exit_time",item.getExitTime());
|
| | | contentValues.put("visitor_type_id",item.getVisitorTypeId());
|
| | | contentValues.put("visitor_id",item.getVisitorId());
|
| | | contentValues.put("visitor_company_id",item.getVisitorCompanyId());
|
| | | contentValues.put("visitee_id",item.getVisiteeId());
|
| | | contentValues.put("visitee_company_id",item.getVisiteeCompanyId());
|
| | | contentValues.put("current_state_id",item.getCurrentStateId());
|
| | | contentValues.put("warning",item.getWarning());
|
| | | contentValues.put("update_time",item.getUpdateTime());
|
| | | contentValues.put("is_synchron",item.getIsSynchron());
|
| | | contentValues.put("device_company_id",item.getDeviceCompanyId());
|
| | | contentValues.put("create_time",item.getCreateTime());
|
| | |
|
| | | long registerId = MainActivity.getInstance().db.insert("visit", "", contentValues);
|
| | | return registerId;
|
| | | }
|
| | |
|
| | |
|