Commit afbfa40f3babdd5ea83651d59055c080e61078f4
1 parent
7a4f49e4
Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/ModulePedometer
# Conflicts: # moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/fragment/RunRaceDetailFragment.java
Showing
2 changed files
with
188 additions
and
2 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/view/RegistrationInfoView.java
| 1 | 1 | package com.cnlive.moudle.pedometer.frame.view; |
| 2 | 2 | |
| 3 | -import android.content.Intent; | |
| 4 | 3 | import android.view.View; |
| 5 | 4 | |
| 6 | 5 | import com.cnlive.moudle.pedometer.model.Constant; |
| 7 | 6 | import com.cnlive.moudle.pedometer.model.MessageEvent; |
| 8 | -import com.cnlive.moudle.pedometer.ui.activity.RunRaceDetailActivity; | |
| 9 | 7 | import com.cnlive.moudle.pedometer.ui.fragment.RegistrationInfoFragment; |
| 10 | 8 | import com.cnlive.moudle.pedometer.utils.DateTimeUtil; |
| 11 | 9 | import com.cnlive.strike.ui.widget.BottomMenuDialog; | ... | ... |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/CollUserStepEntityDao.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.CollUserStepEntity; | |
| 13 | + | |
| 14 | +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. | |
| 15 | +/** | |
| 16 | + * DAO for table "COLL_USER_STEP_ENTITY". | |
| 17 | +*/ | |
| 18 | +public class CollUserStepEntityDao extends AbstractDao<CollUserStepEntity, String> { | |
| 19 | + | |
| 20 | + public static final String TABLENAME = "COLL_USER_STEP_ENTITY"; | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * Properties of entity CollUserStepEntity.<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 UserId = new Property(1, String.class, "userId", false, "USER_ID"); | |
| 29 | + public final static Property Date = new Property(2, String.class, "date", false, "DATE"); | |
| 30 | + public final static Property StepCount = new Property(3, String.class, "stepCount", false, "STEP_COUNT"); | |
| 31 | + public final static Property PauseTimeStamp = new Property(4, long.class, "pauseTimeStamp", false, "PAUSE_TIME_STAMP"); | |
| 32 | + public final static Property RecordTime = new Property(5, long.class, "recordTime", false, "RECORD_TIME"); | |
| 33 | + public final static Property CaloriesCount = new Property(6, double.class, "caloriesCount", false, "CALORIES_COUNT"); | |
| 34 | + public final static Property ServerTraceData = new Property(7, String.class, "serverTraceData", false, "SERVER_TRACE_DATA"); | |
| 35 | + } | |
| 36 | + | |
| 37 | + | |
| 38 | + public CollUserStepEntityDao(DaoConfig config) { | |
| 39 | + super(config); | |
| 40 | + } | |
| 41 | + | |
| 42 | + public CollUserStepEntityDao(DaoConfig config, DaoSession daoSession) { | |
| 43 | + super(config, daoSession); | |
| 44 | + } | |
| 45 | + | |
| 46 | + /** Creates the underlying database table. */ | |
| 47 | + public static void createTable(Database db, boolean ifNotExists) { | |
| 48 | + String constraint = ifNotExists? "IF NOT EXISTS ": ""; | |
| 49 | + db.execSQL("CREATE TABLE " + constraint + "\"COLL_USER_STEP_ENTITY\" (" + // | |
| 50 | + "\"UUID\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid | |
| 51 | + "\"USER_ID\" TEXT," + // 1: userId | |
| 52 | + "\"DATE\" TEXT," + // 2: date | |
| 53 | + "\"STEP_COUNT\" TEXT," + // 3: stepCount | |
| 54 | + "\"PAUSE_TIME_STAMP\" INTEGER NOT NULL ," + // 4: pauseTimeStamp | |
| 55 | + "\"RECORD_TIME\" INTEGER NOT NULL ," + // 5: recordTime | |
| 56 | + "\"CALORIES_COUNT\" REAL NOT NULL ," + // 6: caloriesCount | |
| 57 | + "\"SERVER_TRACE_DATA\" TEXT);"); // 7: serverTraceData | |
| 58 | + } | |
| 59 | + | |
| 60 | + /** Drops the underlying database table. */ | |
| 61 | + public static void dropTable(Database db, boolean ifExists) { | |
| 62 | + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"COLL_USER_STEP_ENTITY\""; | |
| 63 | + db.execSQL(sql); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @Override | |
| 67 | + protected final void bindValues(DatabaseStatement stmt, CollUserStepEntity entity) { | |
| 68 | + stmt.clearBindings(); | |
| 69 | + | |
| 70 | + String uuid = entity.getUuid(); | |
| 71 | + if (uuid != null) { | |
| 72 | + stmt.bindString(1, uuid); | |
| 73 | + } | |
| 74 | + | |
| 75 | + String userId = entity.getUserId(); | |
| 76 | + if (userId != null) { | |
| 77 | + stmt.bindString(2, userId); | |
| 78 | + } | |
| 79 | + | |
| 80 | + String date = entity.getDate(); | |
| 81 | + if (date != null) { | |
| 82 | + stmt.bindString(3, date); | |
| 83 | + } | |
| 84 | + | |
| 85 | + String stepCount = entity.getStepCount(); | |
| 86 | + if (stepCount != null) { | |
| 87 | + stmt.bindString(4, stepCount); | |
| 88 | + } | |
| 89 | + stmt.bindLong(5, entity.getPauseTimeStamp()); | |
| 90 | + stmt.bindLong(6, entity.getRecordTime()); | |
| 91 | + stmt.bindDouble(7, entity.getCaloriesCount()); | |
| 92 | + | |
| 93 | + String serverTraceData = entity.getServerTraceData(); | |
| 94 | + if (serverTraceData != null) { | |
| 95 | + stmt.bindString(8, serverTraceData); | |
| 96 | + } | |
| 97 | + } | |
| 98 | + | |
| 99 | + @Override | |
| 100 | + protected final void bindValues(SQLiteStatement stmt, CollUserStepEntity entity) { | |
| 101 | + stmt.clearBindings(); | |
| 102 | + | |
| 103 | + String uuid = entity.getUuid(); | |
| 104 | + if (uuid != null) { | |
| 105 | + stmt.bindString(1, uuid); | |
| 106 | + } | |
| 107 | + | |
| 108 | + String userId = entity.getUserId(); | |
| 109 | + if (userId != null) { | |
| 110 | + stmt.bindString(2, userId); | |
| 111 | + } | |
| 112 | + | |
| 113 | + String date = entity.getDate(); | |
| 114 | + if (date != null) { | |
| 115 | + stmt.bindString(3, date); | |
| 116 | + } | |
| 117 | + | |
| 118 | + String stepCount = entity.getStepCount(); | |
| 119 | + if (stepCount != null) { | |
| 120 | + stmt.bindString(4, stepCount); | |
| 121 | + } | |
| 122 | + stmt.bindLong(5, entity.getPauseTimeStamp()); | |
| 123 | + stmt.bindLong(6, entity.getRecordTime()); | |
| 124 | + stmt.bindDouble(7, entity.getCaloriesCount()); | |
| 125 | + | |
| 126 | + String serverTraceData = entity.getServerTraceData(); | |
| 127 | + if (serverTraceData != null) { | |
| 128 | + stmt.bindString(8, serverTraceData); | |
| 129 | + } | |
| 130 | + } | |
| 131 | + | |
| 132 | + @Override | |
| 133 | + public String readKey(Cursor cursor, int offset) { | |
| 134 | + return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0); | |
| 135 | + } | |
| 136 | + | |
| 137 | + @Override | |
| 138 | + public CollUserStepEntity readEntity(Cursor cursor, int offset) { | |
| 139 | + CollUserStepEntity entity = new CollUserStepEntity( // | |
| 140 | + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // uuid | |
| 141 | + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userId | |
| 142 | + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // date | |
| 143 | + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // stepCount | |
| 144 | + cursor.getLong(offset + 4), // pauseTimeStamp | |
| 145 | + cursor.getLong(offset + 5), // recordTime | |
| 146 | + cursor.getDouble(offset + 6), // caloriesCount | |
| 147 | + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // serverTraceData | |
| 148 | + ); | |
| 149 | + return entity; | |
| 150 | + } | |
| 151 | + | |
| 152 | + @Override | |
| 153 | + public void readEntity(Cursor cursor, CollUserStepEntity entity, int offset) { | |
| 154 | + entity.setUuid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0)); | |
| 155 | + entity.setUserId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); | |
| 156 | + entity.setDate(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); | |
| 157 | + entity.setStepCount(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); | |
| 158 | + entity.setPauseTimeStamp(cursor.getLong(offset + 4)); | |
| 159 | + entity.setRecordTime(cursor.getLong(offset + 5)); | |
| 160 | + entity.setCaloriesCount(cursor.getDouble(offset + 6)); | |
| 161 | + entity.setServerTraceData(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); | |
| 162 | + } | |
| 163 | + | |
| 164 | + @Override | |
| 165 | + protected final String updateKeyAfterInsert(CollUserStepEntity entity, long rowId) { | |
| 166 | + return entity.getUuid(); | |
| 167 | + } | |
| 168 | + | |
| 169 | + @Override | |
| 170 | + public String getKey(CollUserStepEntity entity) { | |
| 171 | + if(entity != null) { | |
| 172 | + return entity.getUuid(); | |
| 173 | + } else { | |
| 174 | + return null; | |
| 175 | + } | |
| 176 | + } | |
| 177 | + | |
| 178 | + @Override | |
| 179 | + public boolean hasKey(CollUserStepEntity entity) { | |
| 180 | + return entity.getUuid() != null; | |
| 181 | + } | |
| 182 | + | |
| 183 | + @Override | |
| 184 | + protected final boolean isEntityUpdateable() { | |
| 185 | + return true; | |
| 186 | + } | |
| 187 | + | |
| 188 | +} | ... | ... |