Commit ab8a1cd1654bde1f879a99c152e405a6a774bbad

Authored by 杨帅
1 parent 82a3417e

1 修改暂停后,实时轨迹显示逻辑

moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/FailedEntityDao.java 0 → 100644
  1 +package com.cnlive.moudle.pedometer.sql.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.moudle.pedometer.sql.entity.FailedEntity;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "FAILED_ENTITY".
  17 +*/
  18 +public class FailedEntityDao extends AbstractDao<FailedEntity, String> {
  19 +
  20 + public static final String TABLENAME = "FAILED_ENTITY";
  21 +
  22 + /**
  23 + * Properties of entity FailedEntity.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Uuid = new Property(0, String.class, "uuid", true, "UUID");
  28 + public final static Property Uid = new Property(1, String.class, "uid", false, "UID");
  29 + public final static Property IsPause = new Property(2, boolean.class, "isPause", false, "IS_PAUSE");
  30 + public final static Property UserPauseTime = new Property(3, long.class, "userPauseTime", false, "USER_PAUSE_TIME");
  31 + public final static Property UsrContinueTime = new Property(4, long.class, "usrContinueTime", false, "USR_CONTINUE_TIME");
  32 + public final static Property IsFinish = new Property(5, String.class, "isFinish", false, "IS_FINISH");
  33 + public final static Property Time = new Property(6, String.class, "time", false, "TIME");
  34 + public final static Property Speed = new Property(7, String.class, "speed", false, "SPEED");
  35 + public final static Property Step = new Property(8, String.class, "step", false, "STEP");
  36 + public final static Property Distance = new Property(9, String.class, "distance", false, "DISTANCE");
  37 + public final static Property StartPoint = new Property(10, String.class, "startPoint", false, "START_POINT");
  38 + public final static Property EndPoint = new Property(11, String.class, "endPoint", false, "END_POINT");
  39 + public final static Property StreetTraceStartTime = new Property(12, long.class, "streetTraceStartTime", false, "STREET_TRACE_START_TIME");
  40 + public final static Property StreetTraceEndTime = new Property(13, long.class, "streetTraceEndTime", false, "STREET_TRACE_END_TIME");
  41 + public final static Property EntityName = new Property(14, String.class, "entityName", false, "ENTITY_NAME");
  42 + public final static Property UserStartTime = new Property(15, long.class, "userStartTime", false, "USER_START_TIME");
  43 + public final static Property UserEndTime = new Property(16, long.class, "userEndTime", false, "USER_END_TIME");
  44 + public final static Property ImportPoint = new Property(17, String.class, "importPoint", false, "IMPORT_POINT");
  45 + public final static Property StreetId = new Property(18, String.class, "streetId", false, "STREET_ID");
  46 + public final static Property StreetTitle = new Property(19, String.class, "streetTitle", false, "STREET_TITLE");
  47 + public final static Property CreatTimeStamp = new Property(20, long.class, "creatTimeStamp", false, "CREAT_TIME_STAMP");
  48 + }
  49 +
  50 +
  51 + public FailedEntityDao(DaoConfig config) {
  52 + super(config);
  53 + }
  54 +
  55 + public FailedEntityDao(DaoConfig config, DaoSession daoSession) {
  56 + super(config, daoSession);
  57 + }
  58 +
  59 + /** Creates the underlying database table. */
  60 + public static void createTable(Database db, boolean ifNotExists) {
  61 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  62 + db.execSQL("CREATE TABLE " + constraint + "\"FAILED_ENTITY\" (" + //
  63 + "\"UUID\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid
  64 + "\"UID\" TEXT," + // 1: uid
  65 + "\"IS_PAUSE\" INTEGER NOT NULL ," + // 2: isPause
  66 + "\"USER_PAUSE_TIME\" INTEGER NOT NULL ," + // 3: userPauseTime
  67 + "\"USR_CONTINUE_TIME\" INTEGER NOT NULL ," + // 4: usrContinueTime
  68 + "\"IS_FINISH\" TEXT," + // 5: isFinish
  69 + "\"TIME\" TEXT," + // 6: time
  70 + "\"SPEED\" TEXT," + // 7: speed
  71 + "\"STEP\" TEXT," + // 8: step
  72 + "\"DISTANCE\" TEXT," + // 9: distance
  73 + "\"START_POINT\" TEXT," + // 10: startPoint
  74 + "\"END_POINT\" TEXT," + // 11: endPoint
  75 + "\"STREET_TRACE_START_TIME\" INTEGER NOT NULL ," + // 12: streetTraceStartTime
  76 + "\"STREET_TRACE_END_TIME\" INTEGER NOT NULL ," + // 13: streetTraceEndTime
  77 + "\"ENTITY_NAME\" TEXT," + // 14: entityName
  78 + "\"USER_START_TIME\" INTEGER NOT NULL ," + // 15: userStartTime
  79 + "\"USER_END_TIME\" INTEGER NOT NULL ," + // 16: userEndTime
  80 + "\"IMPORT_POINT\" TEXT," + // 17: importPoint
  81 + "\"STREET_ID\" TEXT," + // 18: streetId
  82 + "\"STREET_TITLE\" TEXT," + // 19: streetTitle
  83 + "\"CREAT_TIME_STAMP\" INTEGER NOT NULL );"); // 20: creatTimeStamp
  84 + }
  85 +
  86 + /** Drops the underlying database table. */
  87 + public static void dropTable(Database db, boolean ifExists) {
  88 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"FAILED_ENTITY\"";
  89 + db.execSQL(sql);
  90 + }
  91 +
  92 + @Override
  93 + protected final void bindValues(DatabaseStatement stmt, FailedEntity entity) {
  94 + stmt.clearBindings();
  95 +
  96 + String uuid = entity.getUuid();
  97 + if (uuid != null) {
  98 + stmt.bindString(1, uuid);
  99 + }
  100 +
  101 + String uid = entity.getUid();
  102 + if (uid != null) {
  103 + stmt.bindString(2, uid);
  104 + }
  105 + stmt.bindLong(3, entity.getIsPause() ? 1L: 0L);
  106 + stmt.bindLong(4, entity.getUserPauseTime());
  107 + stmt.bindLong(5, entity.getUsrContinueTime());
  108 +
  109 + String isFinish = entity.getIsFinish();
  110 + if (isFinish != null) {
  111 + stmt.bindString(6, isFinish);
  112 + }
  113 +
  114 + String time = entity.getTime();
  115 + if (time != null) {
  116 + stmt.bindString(7, time);
  117 + }
  118 +
  119 + String speed = entity.getSpeed();
  120 + if (speed != null) {
  121 + stmt.bindString(8, speed);
  122 + }
  123 +
  124 + String step = entity.getStep();
  125 + if (step != null) {
  126 + stmt.bindString(9, step);
  127 + }
  128 +
  129 + String distance = entity.getDistance();
  130 + if (distance != null) {
  131 + stmt.bindString(10, distance);
  132 + }
  133 +
  134 + String startPoint = entity.getStartPoint();
  135 + if (startPoint != null) {
  136 + stmt.bindString(11, startPoint);
  137 + }
  138 +
  139 + String endPoint = entity.getEndPoint();
  140 + if (endPoint != null) {
  141 + stmt.bindString(12, endPoint);
  142 + }
  143 + stmt.bindLong(13, entity.getStreetTraceStartTime());
  144 + stmt.bindLong(14, entity.getStreetTraceEndTime());
  145 +
  146 + String entityName = entity.getEntityName();
  147 + if (entityName != null) {
  148 + stmt.bindString(15, entityName);
  149 + }
  150 + stmt.bindLong(16, entity.getUserStartTime());
  151 + stmt.bindLong(17, entity.getUserEndTime());
  152 +
  153 + String importPoint = entity.getImportPoint();
  154 + if (importPoint != null) {
  155 + stmt.bindString(18, importPoint);
  156 + }
  157 +
  158 + String streetId = entity.getStreetId();
  159 + if (streetId != null) {
  160 + stmt.bindString(19, streetId);
  161 + }
  162 +
  163 + String streetTitle = entity.getStreetTitle();
  164 + if (streetTitle != null) {
  165 + stmt.bindString(20, streetTitle);
  166 + }
  167 + stmt.bindLong(21, entity.getCreatTimeStamp());
  168 + }
  169 +
  170 + @Override
  171 + protected final void bindValues(SQLiteStatement stmt, FailedEntity entity) {
  172 + stmt.clearBindings();
  173 +
  174 + String uuid = entity.getUuid();
  175 + if (uuid != null) {
  176 + stmt.bindString(1, uuid);
  177 + }
  178 +
  179 + String uid = entity.getUid();
  180 + if (uid != null) {
  181 + stmt.bindString(2, uid);
  182 + }
  183 + stmt.bindLong(3, entity.getIsPause() ? 1L: 0L);
  184 + stmt.bindLong(4, entity.getUserPauseTime());
  185 + stmt.bindLong(5, entity.getUsrContinueTime());
  186 +
  187 + String isFinish = entity.getIsFinish();
  188 + if (isFinish != null) {
  189 + stmt.bindString(6, isFinish);
  190 + }
  191 +
  192 + String time = entity.getTime();
  193 + if (time != null) {
  194 + stmt.bindString(7, time);
  195 + }
  196 +
  197 + String speed = entity.getSpeed();
  198 + if (speed != null) {
  199 + stmt.bindString(8, speed);
  200 + }
  201 +
  202 + String step = entity.getStep();
  203 + if (step != null) {
  204 + stmt.bindString(9, step);
  205 + }
  206 +
  207 + String distance = entity.getDistance();
  208 + if (distance != null) {
  209 + stmt.bindString(10, distance);
  210 + }
  211 +
  212 + String startPoint = entity.getStartPoint();
  213 + if (startPoint != null) {
  214 + stmt.bindString(11, startPoint);
  215 + }
  216 +
  217 + String endPoint = entity.getEndPoint();
  218 + if (endPoint != null) {
  219 + stmt.bindString(12, endPoint);
  220 + }
  221 + stmt.bindLong(13, entity.getStreetTraceStartTime());
  222 + stmt.bindLong(14, entity.getStreetTraceEndTime());
  223 +
  224 + String entityName = entity.getEntityName();
  225 + if (entityName != null) {
  226 + stmt.bindString(15, entityName);
  227 + }
  228 + stmt.bindLong(16, entity.getUserStartTime());
  229 + stmt.bindLong(17, entity.getUserEndTime());
  230 +
  231 + String importPoint = entity.getImportPoint();
  232 + if (importPoint != null) {
  233 + stmt.bindString(18, importPoint);
  234 + }
  235 +
  236 + String streetId = entity.getStreetId();
  237 + if (streetId != null) {
  238 + stmt.bindString(19, streetId);
  239 + }
  240 +
  241 + String streetTitle = entity.getStreetTitle();
  242 + if (streetTitle != null) {
  243 + stmt.bindString(20, streetTitle);
  244 + }
  245 + stmt.bindLong(21, entity.getCreatTimeStamp());
  246 + }
  247 +
  248 + @Override
  249 + public String readKey(Cursor cursor, int offset) {
  250 + return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
  251 + }
  252 +
  253 + @Override
  254 + public FailedEntity readEntity(Cursor cursor, int offset) {
  255 + FailedEntity entity = new FailedEntity( //
  256 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // uuid
  257 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // uid
  258 + cursor.getShort(offset + 2) != 0, // isPause
  259 + cursor.getLong(offset + 3), // userPauseTime
  260 + cursor.getLong(offset + 4), // usrContinueTime
  261 + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // isFinish
  262 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // time
  263 + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // speed
  264 + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // step
  265 + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // distance
  266 + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // startPoint
  267 + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // endPoint
  268 + cursor.getLong(offset + 12), // streetTraceStartTime
  269 + cursor.getLong(offset + 13), // streetTraceEndTime
  270 + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // entityName
  271 + cursor.getLong(offset + 15), // userStartTime
  272 + cursor.getLong(offset + 16), // userEndTime
  273 + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // importPoint
  274 + cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // streetId
  275 + cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // streetTitle
  276 + cursor.getLong(offset + 20) // creatTimeStamp
  277 + );
  278 + return entity;
  279 + }
  280 +
  281 + @Override
  282 + public void readEntity(Cursor cursor, FailedEntity entity, int offset) {
  283 + entity.setUuid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  284 + entity.setUid(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  285 + entity.setIsPause(cursor.getShort(offset + 2) != 0);
  286 + entity.setUserPauseTime(cursor.getLong(offset + 3));
  287 + entity.setUsrContinueTime(cursor.getLong(offset + 4));
  288 + entity.setIsFinish(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
  289 + entity.setTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  290 + entity.setSpeed(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
  291 + entity.setStep(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
  292 + entity.setDistance(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
  293 + entity.setStartPoint(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
  294 + entity.setEndPoint(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
  295 + entity.setStreetTraceStartTime(cursor.getLong(offset + 12));
  296 + entity.setStreetTraceEndTime(cursor.getLong(offset + 13));
  297 + entity.setEntityName(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
  298 + entity.setUserStartTime(cursor.getLong(offset + 15));
  299 + entity.setUserEndTime(cursor.getLong(offset + 16));
  300 + entity.setImportPoint(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
  301 + entity.setStreetId(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
  302 + entity.setStreetTitle(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
  303 + entity.setCreatTimeStamp(cursor.getLong(offset + 20));
  304 + }
  305 +
  306 + @Override
  307 + protected final String updateKeyAfterInsert(FailedEntity entity, long rowId) {
  308 + return entity.getUuid();
  309 + }
  310 +
  311 + @Override
  312 + public String getKey(FailedEntity entity) {
  313 + if(entity != null) {
  314 + return entity.getUuid();
  315 + } else {
  316 + return null;
  317 + }
  318 + }
  319 +
  320 + @Override
  321 + public boolean hasKey(FailedEntity entity) {
  322 + return entity.getUuid() != null;
  323 + }
  324 +
  325 + @Override
  326 + protected final boolean isEntityUpdateable() {
  327 + return true;
  328 + }
  329 +
  330 +}
... ...