From aa1e23c76caa063a337bfc265960cd826c6d6dbc Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期五, 21 七月 2017 12:18:27 +0800
Subject: [PATCH]
---
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/RegisterDao.java | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/RegisterDao.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/RegisterDao.java
index ad0fc73..a3be79e 100644
--- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/RegisterDao.java
+++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/RegisterDao.java
@@ -22,11 +22,55 @@
/**
* 璁垮娉ㄥ唽
- * @param params
- * @param idCardHeadPhoto
* @return
*/
- public boolean add(RequestParams params, String idCardHeadPhoto) {
+ public boolean add(OfflineVisitorRegisterItem item) {
+ String sql =
+ "INSERT INTO offline_visitor_register (\n" +
+ " visitor_id,\n" +
+ " username,\n" +
+ " mobile_phone,\n" +
+ " gender_id,\n" +
+ " identity_type_id,\n" +
+ " country_id,\n" +
+ " visitor_type_id,\n" +
+ " identify_num,\n" +
+ " company_id,\n" +
+ " birthday,\n" +
+ " remark,\n" +
+ " raw_surveillance_photo_path,\n" +
+ " raw_surveillance_photo_width,\n" +
+ " raw_surveillance_photo_height,\n" +
+ " surveillance_photo_path,\n" +
+ " upload_custom_photo_path,\n" +
+ " id_card_photo_path,\n" +
+ " create_time\n" +
+ ")\n" +
+ "VALUES\n" +
+ " (\n" +
+ " null,\n" +
+ " '"+item.getUsername()+"',\n" +
+ " '"+item.getMobilePhone()+"',\n" +
+ " '"+item.getGenderId()+"',\n" +
+ " '"+item.getIdentityTypeId()+"',\n" +
+ " '"+item.getCountryId()+"',\n" +
+ " '"+item.getVisitorTypeId()+"',\n" +
+ " '"+item.getIdentifyNum()+"',\n" +
+ " '"+item.getCompanyId()+"',\n" +
+ " '"+item.getBirthday()+"',\n" +
+ " '"+item.getRemark()+"',\n" +
+ " '"+item.getRawSurveillancePhotoPath()+"',\n" +
+ " '"+item.getRawSurveillancePhotoWidth()+"',\n" +
+ " '"+item.getRawSurveillancePhotoHeight()+"',\n" +
+ " '"+item.getSurveillancePhotoPath()+"',\n" +
+ " '"+item.getUploadCustomPhotoPath()+"',\n" +
+ " '"+item.getIdCardPhotoPath()+"',\n" +
+ " '"+item.getCreateTime()+"'\n" +
+ " )";
+ SQLiteDatabase db = Config.sqlMap.getDb();
+ db.beginTransaction();
+ db.execSQL(sql);
+ db.endTransaction();
return true;
}
@@ -41,13 +85,13 @@
}
public boolean hasOfflineVisitorRegisterData() {
- Cursor c = Config.sqlMap.getDb().rawQuery("select count(*) from register", new String[]{});
+ Cursor c = Config.sqlMap.getDb().rawQuery("select count(*) from offline_visitor_register", new String[]{});
c.moveToFirst();
return c.getInt(0) > 0 ? true : false;
}
public boolean hasOfflineAttenderRegisterData() {
- Cursor c = Config.sqlMap.getDb().rawQuery("select count(*) from register", new String[]{});
+ Cursor c = Config.sqlMap.getDb().rawQuery("select count(*) from offline_attender_register", new String[]{});
c.moveToFirst();
return c.getInt(0) > 0 ? true : false;
}
--
Gitblit v1.8.0