This commit is contained in:
wangcongtao
2020-07-10 17:00:04 +08:00
parent d7f0582f6f
commit 00e5feb5e1
517 changed files with 7911 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
package com.alibaba.android.arouter.routes;
import com.alibaba.android.arouter.facade.enums.RouteType;
import com.alibaba.android.arouter.facade.model.RouteMeta;
import com.alibaba.android.arouter.facade.template.IRouteGroup;
import com.zhidao.mogo.module.event.panel.EventPanelModuleProvider;
import java.lang.Override;
import java.lang.String;
import java.util.Map;
/**
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
public class ARouter$$Group$$event implements IRouteGroup {
@Override
public void loadInto(Map<String, RouteMeta> atlas) {
atlas.put("/event/panel", RouteMeta.build(RouteType.PROVIDER, EventPanelModuleProvider.class, "/event/panel", "event", null, -1, -2147483648));
}
}

View File

@@ -0,0 +1,18 @@
package com.alibaba.android.arouter.routes;
import com.alibaba.android.arouter.facade.enums.RouteType;
import com.alibaba.android.arouter.facade.model.RouteMeta;
import com.alibaba.android.arouter.facade.template.IProviderGroup;
import com.zhidao.mogo.module.event.panel.EventPanelModuleProvider;
import java.lang.Override;
import java.lang.String;
import java.util.Map;
/**
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
public class ARouter$$Providers$$mogomoduleeventpanel implements IProviderGroup {
@Override
public void loadInto(Map<String, RouteMeta> providers) {
providers.put("com.mogo.service.eventpanel.IEventPanelProvider", RouteMeta.build(RouteType.PROVIDER, EventPanelModuleProvider.class, "/event/panel", "event", null, -1, -2147483648));
}
}

View File

@@ -0,0 +1,17 @@
package com.alibaba.android.arouter.routes;
import com.alibaba.android.arouter.facade.template.IRouteGroup;
import com.alibaba.android.arouter.facade.template.IRouteRoot;
import java.lang.Class;
import java.lang.Override;
import java.lang.String;
import java.util.Map;
/**
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
public class ARouter$$Root$$mogomoduleeventpanel implements IRouteRoot {
@Override
public void loadInto(Map<String, Class<? extends IRouteGroup>> routes) {
routes.put("event", ARouter$$Group$$event.class);
}
}

View File

@@ -0,0 +1,276 @@
package com.zhidao.mogo.module.event.panel.dao;
import android.database.Cursor;
import androidx.room.EntityDeletionOrUpdateAdapter;
import androidx.room.EntityInsertionAdapter;
import androidx.room.RoomDatabase;
import androidx.room.RoomSQLiteQuery;
import androidx.room.SharedSQLiteStatement;
import androidx.sqlite.db.SupportSQLiteStatement;
import com.zhidao.mogo.module.event.panel.bean.TripRecord;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.ArrayList;
import java.util.List;
@SuppressWarnings("unchecked")
public final class TripRecordDao_Impl implements TripRecordDao {
private final RoomDatabase __db;
private final EntityInsertionAdapter __insertionAdapterOfTripRecord;
private final EntityDeletionOrUpdateAdapter __deletionAdapterOfTripRecord;
private final EntityDeletionOrUpdateAdapter __updateAdapterOfTripRecord;
private final SharedSQLiteStatement __preparedStmtOfDeleteOvertimeTripRecord;
public TripRecordDao_Impl(RoomDatabase __db) {
this.__db = __db;
this.__insertionAdapterOfTripRecord = new EntityInsertionAdapter<TripRecord>(__db) {
@Override
public String createQuery() {
return "INSERT OR REPLACE INTO `TripRecord`(`id`,`eventId`,`eventType`,`usefulStatus`,`entity`,`recordTime`) VALUES (?,?,?,?,?,?)";
}
@Override
public void bind(SupportSQLiteStatement stmt, TripRecord value) {
stmt.bindLong(1, value.getId());
if (value.getEventId() == null) {
stmt.bindNull(2);
} else {
stmt.bindString(2, value.getEventId());
}
stmt.bindLong(3, value.getEventType());
if (value.getUsefulStatus() == null) {
stmt.bindNull(4);
} else {
stmt.bindString(4, value.getUsefulStatus());
}
if (value.getEntity() == null) {
stmt.bindNull(5);
} else {
stmt.bindString(5, value.getEntity());
}
stmt.bindLong(6, value.getRecordTime());
}
};
this.__deletionAdapterOfTripRecord = new EntityDeletionOrUpdateAdapter<TripRecord>(__db) {
@Override
public String createQuery() {
return "DELETE FROM `TripRecord` WHERE `id` = ?";
}
@Override
public void bind(SupportSQLiteStatement stmt, TripRecord value) {
stmt.bindLong(1, value.getId());
}
};
this.__updateAdapterOfTripRecord = new EntityDeletionOrUpdateAdapter<TripRecord>(__db) {
@Override
public String createQuery() {
return "UPDATE OR ABORT `TripRecord` SET `id` = ?,`eventId` = ?,`eventType` = ?,`usefulStatus` = ?,`entity` = ?,`recordTime` = ? WHERE `id` = ?";
}
@Override
public void bind(SupportSQLiteStatement stmt, TripRecord value) {
stmt.bindLong(1, value.getId());
if (value.getEventId() == null) {
stmt.bindNull(2);
} else {
stmt.bindString(2, value.getEventId());
}
stmt.bindLong(3, value.getEventType());
if (value.getUsefulStatus() == null) {
stmt.bindNull(4);
} else {
stmt.bindString(4, value.getUsefulStatus());
}
if (value.getEntity() == null) {
stmt.bindNull(5);
} else {
stmt.bindString(5, value.getEntity());
}
stmt.bindLong(6, value.getRecordTime());
stmt.bindLong(7, value.getId());
}
};
this.__preparedStmtOfDeleteOvertimeTripRecord = new SharedSQLiteStatement(__db) {
@Override
public String createQuery() {
final String _query = "DELETE FROM TripRecord WHERE recordTime < ?";
return _query;
}
};
}
@Override
public void insert(TripRecord... tripRecord) {
__db.beginTransaction();
try {
__insertionAdapterOfTripRecord.insert(tripRecord);
__db.setTransactionSuccessful();
} finally {
__db.endTransaction();
}
}
@Override
public void delete(TripRecord... tripRecord) {
__db.beginTransaction();
try {
__deletionAdapterOfTripRecord.handleMultiple(tripRecord);
__db.setTransactionSuccessful();
} finally {
__db.endTransaction();
}
}
@Override
public void update(TripRecord... tripRecord) {
__db.beginTransaction();
try {
__updateAdapterOfTripRecord.handleMultiple(tripRecord);
__db.setTransactionSuccessful();
} finally {
__db.endTransaction();
}
}
@Override
public void deleteOvertimeTripRecord(long limitTime) {
final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteOvertimeTripRecord.acquire();
__db.beginTransaction();
try {
int _argIndex = 1;
_stmt.bindLong(_argIndex, limitTime);
_stmt.executeUpdateDelete();
__db.setTransactionSuccessful();
} finally {
__db.endTransaction();
__preparedStmtOfDeleteOvertimeTripRecord.release(_stmt);
}
}
@Override
public List<TripRecord> queryAllTripRecord(long limitTime) {
final String _sql = "SELECT * FROM TripRecord WHERE recordTime > ? ORDER BY recordTime DESC";
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
_statement.bindLong(_argIndex, limitTime);
final Cursor _cursor = __db.query(_statement);
try {
final int _cursorIndexOfId = _cursor.getColumnIndexOrThrow("id");
final int _cursorIndexOfEventId = _cursor.getColumnIndexOrThrow("eventId");
final int _cursorIndexOfEventType = _cursor.getColumnIndexOrThrow("eventType");
final int _cursorIndexOfUsefulStatus = _cursor.getColumnIndexOrThrow("usefulStatus");
final int _cursorIndexOfEntity = _cursor.getColumnIndexOrThrow("entity");
final int _cursorIndexOfRecordTime = _cursor.getColumnIndexOrThrow("recordTime");
final List<TripRecord> _result = new ArrayList<TripRecord>(_cursor.getCount());
while(_cursor.moveToNext()) {
final TripRecord _item;
final int _tmpId;
_tmpId = _cursor.getInt(_cursorIndexOfId);
final String _tmpEventId;
_tmpEventId = _cursor.getString(_cursorIndexOfEventId);
final int _tmpEventType;
_tmpEventType = _cursor.getInt(_cursorIndexOfEventType);
final String _tmpUsefulStatus;
_tmpUsefulStatus = _cursor.getString(_cursorIndexOfUsefulStatus);
final String _tmpEntity;
_tmpEntity = _cursor.getString(_cursorIndexOfEntity);
final long _tmpRecordTime;
_tmpRecordTime = _cursor.getLong(_cursorIndexOfRecordTime);
_item = new TripRecord(_tmpId,_tmpEventId,_tmpEventType,_tmpUsefulStatus,_tmpEntity,_tmpRecordTime);
_result.add(_item);
}
return _result;
} finally {
_cursor.close();
_statement.release();
}
}
@Override
public TripRecord queryTripRecordByEventId(String eventId) {
final String _sql = "SELECT * FROM TripRecord WHERE eventId = ?";
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
if (eventId == null) {
_statement.bindNull(_argIndex);
} else {
_statement.bindString(_argIndex, eventId);
}
final Cursor _cursor = __db.query(_statement);
try {
final int _cursorIndexOfId = _cursor.getColumnIndexOrThrow("id");
final int _cursorIndexOfEventId = _cursor.getColumnIndexOrThrow("eventId");
final int _cursorIndexOfEventType = _cursor.getColumnIndexOrThrow("eventType");
final int _cursorIndexOfUsefulStatus = _cursor.getColumnIndexOrThrow("usefulStatus");
final int _cursorIndexOfEntity = _cursor.getColumnIndexOrThrow("entity");
final int _cursorIndexOfRecordTime = _cursor.getColumnIndexOrThrow("recordTime");
final TripRecord _result;
if(_cursor.moveToFirst()) {
final int _tmpId;
_tmpId = _cursor.getInt(_cursorIndexOfId);
final String _tmpEventId;
_tmpEventId = _cursor.getString(_cursorIndexOfEventId);
final int _tmpEventType;
_tmpEventType = _cursor.getInt(_cursorIndexOfEventType);
final String _tmpUsefulStatus;
_tmpUsefulStatus = _cursor.getString(_cursorIndexOfUsefulStatus);
final String _tmpEntity;
_tmpEntity = _cursor.getString(_cursorIndexOfEntity);
final long _tmpRecordTime;
_tmpRecordTime = _cursor.getLong(_cursorIndexOfRecordTime);
_result = new TripRecord(_tmpId,_tmpEventId,_tmpEventType,_tmpUsefulStatus,_tmpEntity,_tmpRecordTime);
} else {
_result = null;
}
return _result;
} finally {
_cursor.close();
_statement.release();
}
}
@Override
public TripRecord queryTripRecordById(int id) {
final String _sql = "SELECT * FROM TripRecord WHERE id = ?";
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
_statement.bindLong(_argIndex, id);
final Cursor _cursor = __db.query(_statement);
try {
final int _cursorIndexOfId = _cursor.getColumnIndexOrThrow("id");
final int _cursorIndexOfEventId = _cursor.getColumnIndexOrThrow("eventId");
final int _cursorIndexOfEventType = _cursor.getColumnIndexOrThrow("eventType");
final int _cursorIndexOfUsefulStatus = _cursor.getColumnIndexOrThrow("usefulStatus");
final int _cursorIndexOfEntity = _cursor.getColumnIndexOrThrow("entity");
final int _cursorIndexOfRecordTime = _cursor.getColumnIndexOrThrow("recordTime");
final TripRecord _result;
if(_cursor.moveToFirst()) {
final int _tmpId;
_tmpId = _cursor.getInt(_cursorIndexOfId);
final String _tmpEventId;
_tmpEventId = _cursor.getString(_cursorIndexOfEventId);
final int _tmpEventType;
_tmpEventType = _cursor.getInt(_cursorIndexOfEventType);
final String _tmpUsefulStatus;
_tmpUsefulStatus = _cursor.getString(_cursorIndexOfUsefulStatus);
final String _tmpEntity;
_tmpEntity = _cursor.getString(_cursorIndexOfEntity);
final long _tmpRecordTime;
_tmpRecordTime = _cursor.getLong(_cursorIndexOfRecordTime);
_result = new TripRecord(_tmpId,_tmpEventId,_tmpEventType,_tmpUsefulStatus,_tmpEntity,_tmpRecordTime);
} else {
_result = null;
}
return _result;
} finally {
_cursor.close();
_statement.release();
}
}
}

View File

@@ -0,0 +1,124 @@
package com.zhidao.mogo.module.event.panel.dao;
import androidx.room.DatabaseConfiguration;
import androidx.room.InvalidationTracker;
import androidx.room.RoomOpenHelper;
import androidx.room.RoomOpenHelper.Delegate;
import androidx.room.util.TableInfo;
import androidx.room.util.TableInfo.Column;
import androidx.room.util.TableInfo.ForeignKey;
import androidx.room.util.TableInfo.Index;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import androidx.sqlite.db.SupportSQLiteOpenHelper.Callback;
import androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration;
import java.lang.IllegalStateException;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.HashMap;
import java.util.HashSet;
@SuppressWarnings("unchecked")
public final class TripRecordDatabase_Impl extends TripRecordDatabase {
private volatile TripRecordDao _tripRecordDao;
@Override
protected SupportSQLiteOpenHelper createOpenHelper(DatabaseConfiguration configuration) {
final SupportSQLiteOpenHelper.Callback _openCallback = new RoomOpenHelper(configuration, new RoomOpenHelper.Delegate(1) {
@Override
public void createAllTables(SupportSQLiteDatabase _db) {
_db.execSQL("CREATE TABLE IF NOT EXISTS `TripRecord` (`id` INTEGER NOT NULL, `eventId` TEXT NOT NULL, `eventType` INTEGER NOT NULL, `usefulStatus` TEXT NOT NULL, `entity` TEXT NOT NULL, `recordTime` INTEGER NOT NULL, PRIMARY KEY(`id`))");
_db.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
_db.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"defc464f299b42840c16887282585427\")");
}
@Override
public void dropAllTables(SupportSQLiteDatabase _db) {
_db.execSQL("DROP TABLE IF EXISTS `TripRecord`");
}
@Override
protected void onCreate(SupportSQLiteDatabase _db) {
if (mCallbacks != null) {
for (int _i = 0, _size = mCallbacks.size(); _i < _size; _i++) {
mCallbacks.get(_i).onCreate(_db);
}
}
}
@Override
public void onOpen(SupportSQLiteDatabase _db) {
mDatabase = _db;
internalInitInvalidationTracker(_db);
if (mCallbacks != null) {
for (int _i = 0, _size = mCallbacks.size(); _i < _size; _i++) {
mCallbacks.get(_i).onOpen(_db);
}
}
}
@Override
protected void validateMigration(SupportSQLiteDatabase _db) {
final HashMap<String, TableInfo.Column> _columnsTripRecord = new HashMap<String, TableInfo.Column>(6);
_columnsTripRecord.put("id", new TableInfo.Column("id", "INTEGER", true, 1));
_columnsTripRecord.put("eventId", new TableInfo.Column("eventId", "TEXT", true, 0));
_columnsTripRecord.put("eventType", new TableInfo.Column("eventType", "INTEGER", true, 0));
_columnsTripRecord.put("usefulStatus", new TableInfo.Column("usefulStatus", "TEXT", true, 0));
_columnsTripRecord.put("entity", new TableInfo.Column("entity", "TEXT", true, 0));
_columnsTripRecord.put("recordTime", new TableInfo.Column("recordTime", "INTEGER", true, 0));
final HashSet<TableInfo.ForeignKey> _foreignKeysTripRecord = new HashSet<TableInfo.ForeignKey>(0);
final HashSet<TableInfo.Index> _indicesTripRecord = new HashSet<TableInfo.Index>(0);
final TableInfo _infoTripRecord = new TableInfo("TripRecord", _columnsTripRecord, _foreignKeysTripRecord, _indicesTripRecord);
final TableInfo _existingTripRecord = TableInfo.read(_db, "TripRecord");
if (! _infoTripRecord.equals(_existingTripRecord)) {
throw new IllegalStateException("Migration didn't properly handle TripRecord(com.zhidao.mogo.module.event.panel.bean.TripRecord).\n"
+ " Expected:\n" + _infoTripRecord + "\n"
+ " Found:\n" + _existingTripRecord);
}
}
}, "defc464f299b42840c16887282585427", "9fe5f51cfb8d02b5a7d3723e1f4fb290");
final SupportSQLiteOpenHelper.Configuration _sqliteConfig = SupportSQLiteOpenHelper.Configuration.builder(configuration.context)
.name(configuration.name)
.callback(_openCallback)
.build();
final SupportSQLiteOpenHelper _helper = configuration.sqliteOpenHelperFactory.create(_sqliteConfig);
return _helper;
}
@Override
protected InvalidationTracker createInvalidationTracker() {
return new InvalidationTracker(this, "TripRecord");
}
@Override
public void clearAllTables() {
super.assertNotMainThread();
final SupportSQLiteDatabase _db = super.getOpenHelper().getWritableDatabase();
try {
super.beginTransaction();
_db.execSQL("DELETE FROM `TripRecord`");
super.setTransactionSuccessful();
} finally {
super.endTransaction();
_db.query("PRAGMA wal_checkpoint(FULL)").close();
if (!_db.inTransaction()) {
_db.execSQL("VACUUM");
}
}
}
@Override
public TripRecordDao getTripRecordDao() {
if (_tripRecordDao != null) {
return _tripRecordDao;
} else {
synchronized(this) {
if(_tripRecordDao == null) {
_tripRecordDao = new TripRecordDao_Impl(this);
}
return _tripRecordDao;
}
}
}
}