diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 6491987..cfa2a24 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final SmallLabelBeanDao smallLabelBeanDao; private final TaskBeanDao taskBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(SmallLabelBean.class, smallLabelBeanDao); registerDao(TaskBean.class, taskBeanDao); } - + public void clear() { labelBeanDaoConfig.clearIdentityScope(); smallLabelBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 6491987..cfa2a24 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final SmallLabelBeanDao smallLabelBeanDao; private final TaskBeanDao taskBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(SmallLabelBean.class, smallLabelBeanDao); registerDao(TaskBean.class, taskBeanDao); } - + public void clear() { labelBeanDaoConfig.clearIdentityScope(); smallLabelBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java index 99e1ff9..94a73c4 100644 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "LABEL_BEAN". -*/ + */ public class LabelBeanDao extends AbstractDao { public static final String TABLENAME = "LABEL_BEAN"; @@ -57,14 +58,16 @@ public LabelBeanDao(DaoConfig config) { super(config); } - + public LabelBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"OBJECT_TYPE\" TEXT," + // 1: objectType @@ -95,7 +98,9 @@ "\"IMAGE_PATH\" TEXT);"); // 26: imagePath } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; db.execSQL(sql); @@ -104,137 +109,137 @@ @Override protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(2, objectType); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(3, pipelineType); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(5, pipelineDiameter); } - + String buryDeep = entity.getBuryDeep(); if (buryDeep != null) { stmt.bindString(6, buryDeep); } - + String lowerType = entity.getLowerType(); if (lowerType != null) { stmt.bindString(7, lowerType); } - + String lowerMaterial = entity.getLowerMaterial(); if (lowerMaterial != null) { stmt.bindString(8, lowerMaterial); } - + String lowerDiameter = entity.getLowerDiameter(); if (lowerDiameter != null) { stmt.bindString(9, lowerDiameter); } - + String lowerDeep = entity.getLowerDeep(); if (lowerDeep != null) { stmt.bindString(10, lowerDeep); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(11, buryMethod); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(12, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(13, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(14, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(15, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(16, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(17, objectId); } - + String identifierId = entity.getIdentifierId(); if (identifierId != null) { stmt.bindString(18, identifierId); } - + String identifierType = entity.getIdentifierType(); if (identifierType != null) { stmt.bindString(19, identifierType); } - + String identifierDeep = entity.getIdentifierDeep(); if (identifierDeep != null) { stmt.bindString(20, identifierDeep); } - + String person = entity.getPerson(); if (person != null) { stmt.bindString(21, person); } - + String installTime = entity.getInstallTime(); if (installTime != null) { stmt.bindString(22, installTime); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(23, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(24, lat); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(25, color); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(26, remark); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -244,137 +249,137 @@ @Override protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(2, objectType); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(3, pipelineType); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(5, pipelineDiameter); } - + String buryDeep = entity.getBuryDeep(); if (buryDeep != null) { stmt.bindString(6, buryDeep); } - + String lowerType = entity.getLowerType(); if (lowerType != null) { stmt.bindString(7, lowerType); } - + String lowerMaterial = entity.getLowerMaterial(); if (lowerMaterial != null) { stmt.bindString(8, lowerMaterial); } - + String lowerDiameter = entity.getLowerDiameter(); if (lowerDiameter != null) { stmt.bindString(9, lowerDiameter); } - + String lowerDeep = entity.getLowerDeep(); if (lowerDeep != null) { stmt.bindString(10, lowerDeep); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(11, buryMethod); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(12, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(13, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(14, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(15, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(16, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(17, objectId); } - + String identifierId = entity.getIdentifierId(); if (identifierId != null) { stmt.bindString(18, identifierId); } - + String identifierType = entity.getIdentifierType(); if (identifierType != null) { stmt.bindString(19, identifierType); } - + String identifierDeep = entity.getIdentifierDeep(); if (identifierDeep != null) { stmt.bindString(20, identifierDeep); } - + String person = entity.getPerson(); if (person != null) { stmt.bindString(21, person); } - + String installTime = entity.getInstallTime(); if (installTime != null) { stmt.bindString(22, installTime); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(23, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(24, lat); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(25, color); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(26, remark); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -384,42 +389,42 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public LabelBean readEntity(Cursor cursor, int offset) { LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath ); return entity; } - + @Override public void readEntity(Cursor cursor, LabelBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -449,17 +454,17 @@ entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - + } + @Override protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(LabelBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -475,5 +480,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/greendao/DaoSession.java b/app/src/main/java/com/casic/detector/greendao/DaoSession.java index 6491987..cfa2a24 100644 --- a/app/src/main/java/com/casic/detector/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/detector/greendao/DaoSession.java @@ -16,7 +16,7 @@ /** * {@inheritDoc} - * + * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { @@ -29,8 +29,7 @@ private final SmallLabelBeanDao smallLabelBeanDao; private final TaskBeanDao taskBeanDao; - public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> - daoConfigMap) { + public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone(); @@ -50,7 +49,7 @@ registerDao(SmallLabelBean.class, smallLabelBeanDao); registerDao(TaskBean.class, taskBeanDao); } - + public void clear() { labelBeanDaoConfig.clearIdentityScope(); smallLabelBeanDaoConfig.clearIdentityScope(); diff --git a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java index 99e1ff9..94a73c4 100644 --- a/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java +++ b/app/src/main/java/com/casic/detector/greendao/LabelBeanDao.java @@ -12,9 +12,10 @@ import org.greenrobot.greendao.internal.DaoConfig; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** + +/** * DAO for table "LABEL_BEAN". -*/ + */ public class LabelBeanDao extends AbstractDao { public static final String TABLENAME = "LABEL_BEAN"; @@ -57,14 +58,16 @@ public LabelBeanDao(DaoConfig config) { super(config); } - + public LabelBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } - /** Creates the underlying database table. */ + /** + * Creates the underlying database table. + */ public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; + String constraint = ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "\"LABEL_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"OBJECT_TYPE\" TEXT," + // 1: objectType @@ -95,7 +98,9 @@ "\"IMAGE_PATH\" TEXT);"); // 26: imagePath } - /** Drops the underlying database table. */ + /** + * Drops the underlying database table. + */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LABEL_BEAN\""; db.execSQL(sql); @@ -104,137 +109,137 @@ @Override protected final void bindValues(DatabaseStatement stmt, LabelBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(2, objectType); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(3, pipelineType); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(5, pipelineDiameter); } - + String buryDeep = entity.getBuryDeep(); if (buryDeep != null) { stmt.bindString(6, buryDeep); } - + String lowerType = entity.getLowerType(); if (lowerType != null) { stmt.bindString(7, lowerType); } - + String lowerMaterial = entity.getLowerMaterial(); if (lowerMaterial != null) { stmt.bindString(8, lowerMaterial); } - + String lowerDiameter = entity.getLowerDiameter(); if (lowerDiameter != null) { stmt.bindString(9, lowerDiameter); } - + String lowerDeep = entity.getLowerDeep(); if (lowerDeep != null) { stmt.bindString(10, lowerDeep); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(11, buryMethod); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(12, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(13, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(14, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(15, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(16, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(17, objectId); } - + String identifierId = entity.getIdentifierId(); if (identifierId != null) { stmt.bindString(18, identifierId); } - + String identifierType = entity.getIdentifierType(); if (identifierType != null) { stmt.bindString(19, identifierType); } - + String identifierDeep = entity.getIdentifierDeep(); if (identifierDeep != null) { stmt.bindString(20, identifierDeep); } - + String person = entity.getPerson(); if (person != null) { stmt.bindString(21, person); } - + String installTime = entity.getInstallTime(); if (installTime != null) { stmt.bindString(22, installTime); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(23, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(24, lat); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(25, color); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(26, remark); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -244,137 +249,137 @@ @Override protected final void bindValues(SQLiteStatement stmt, LabelBean entity) { stmt.clearBindings(); - + Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } - + String objectType = entity.getObjectType(); if (objectType != null) { stmt.bindString(2, objectType); } - + String pipelineType = entity.getPipelineType(); if (pipelineType != null) { stmt.bindString(3, pipelineType); } - + String pipelineMaterial = entity.getPipelineMaterial(); if (pipelineMaterial != null) { stmt.bindString(4, pipelineMaterial); } - + String pipelineDiameter = entity.getPipelineDiameter(); if (pipelineDiameter != null) { stmt.bindString(5, pipelineDiameter); } - + String buryDeep = entity.getBuryDeep(); if (buryDeep != null) { stmt.bindString(6, buryDeep); } - + String lowerType = entity.getLowerType(); if (lowerType != null) { stmt.bindString(7, lowerType); } - + String lowerMaterial = entity.getLowerMaterial(); if (lowerMaterial != null) { stmt.bindString(8, lowerMaterial); } - + String lowerDiameter = entity.getLowerDiameter(); if (lowerDiameter != null) { stmt.bindString(9, lowerDiameter); } - + String lowerDeep = entity.getLowerDeep(); if (lowerDeep != null) { stmt.bindString(10, lowerDeep); } - + String buryMethod = entity.getBuryMethod(); if (buryMethod != null) { stmt.bindString(11, buryMethod); } - + String area = entity.getArea(); if (area != null) { stmt.bindString(12, area); } - + String line = entity.getLine(); if (line != null) { stmt.bindString(13, line); } - + String road = entity.getRoad(); if (road != null) { stmt.bindString(14, road); } - + String constructTime = entity.getConstructTime(); if (constructTime != null) { stmt.bindString(15, constructTime); } - + String owner = entity.getOwner(); if (owner != null) { stmt.bindString(16, owner); } - + String objectId = entity.getObjectId(); if (objectId != null) { stmt.bindString(17, objectId); } - + String identifierId = entity.getIdentifierId(); if (identifierId != null) { stmt.bindString(18, identifierId); } - + String identifierType = entity.getIdentifierType(); if (identifierType != null) { stmt.bindString(19, identifierType); } - + String identifierDeep = entity.getIdentifierDeep(); if (identifierDeep != null) { stmt.bindString(20, identifierDeep); } - + String person = entity.getPerson(); if (person != null) { stmt.bindString(21, person); } - + String installTime = entity.getInstallTime(); if (installTime != null) { stmt.bindString(22, installTime); } - + String lng = entity.getLng(); if (lng != null) { stmt.bindString(23, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(24, lat); } - + String color = entity.getColor(); if (color != null) { stmt.bindString(25, color); } - + String remark = entity.getRemark(); if (remark != null) { stmt.bindString(26, remark); } - + String imagePath = entity.getImagePath(); if (imagePath != null) { stmt.bindString(27, imagePath); @@ -384,42 +389,42 @@ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } + } @Override public LabelBean readEntity(Cursor cursor, int offset) { LabelBean entity = new LabelBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter - cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod - cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area - cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line - cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road - cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime - cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner - cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId - cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId - cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType - cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep - cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person - cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime - cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng - cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat - cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color - cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark - cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // objectType + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineType + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pipelineDiameter + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDeep + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lowerType + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lowerMaterial + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lowerDiameter + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lowerDeep + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // buryMethod + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // area + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // line + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // road + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // constructTime + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // owner + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // objectId + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // identifierId + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // identifierType + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // identifierDeep + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // person + cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // installTime + cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // lng + cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // lat + cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // color + cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // remark + cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath ); return entity; } - + @Override public void readEntity(Cursor cursor, LabelBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); @@ -449,17 +454,17 @@ entity.setColor(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24)); entity.setRemark(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25)); entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26)); - } - + } + @Override protected final Long updateKeyAfterInsert(LabelBean entity, long rowId) { entity.setId(rowId); return rowId; } - + @Override public Long getKey(LabelBean entity) { - if(entity != null) { + if (entity != null) { return entity.getId(); } else { return null; @@ -475,5 +480,5 @@ protected final boolean isEntityUpdateable() { return true; } - + } diff --git a/app/src/main/java/com/casic/detector/view/MainActivity.kt b/app/src/main/java/com/casic/detector/view/MainActivity.kt index cb3d853..05e64e4 100644 --- a/app/src/main/java/com/casic/detector/view/MainActivity.kt +++ b/app/src/main/java/com/casic/detector/view/MainActivity.kt @@ -219,6 +219,8 @@ taskViewModel.uploadTaskMarkerResult.observe(this) { "自由巡检任务已完成".show(this) ids.clear() + //清空自由巡检添加的Marker + aMap.clear() } } @@ -386,7 +388,7 @@ }).build().show() } else { AlertMessageDialog.Builder().setContext(this).setTitle("温馨提示") - .setMessage("现有任务已完成,请点击右上角菜单下载新工单或者开始自由巡检") + .setMessage("所有任务已完成,请点击右上角菜单下载新工单或者开始自由巡检") .setPositiveButton("开始自由巡检").setOnDialogButtonClickListener(object : AlertMessageDialog.OnDialogButtonClickListener { override fun onConfirmClick() { @@ -503,9 +505,20 @@ //只响一次,因为探测频率高,所以依旧是连续的报警声 soundPool.play(soundResourceId, 1f, 1f, 0, 0, 1f) "标识器${markerId}已探测".show(this) - ids.add(markerId) //添加地图Marker - + if (!ids.contains(markerId)) { + //根据markerId查询标识器经纬度 + val labels = DataBaseManager.get.queryLabelById(markerId) + if (labels.isNotEmpty()) { + val bean = labels.first() + aMap.addMarker( + MarkerOptions() + .position(LatLng(bean.lat.toDouble(), bean.lng.toDouble())) + .icon(BitmapDescriptorFactory.fromResource(R.mipmap.label_blue1)) + ) + } + } + ids.add(markerId) } } }