"(" +
"CardId INT, " +
"UpdateTime INT," +
- "CardData TEXT, " +
"CardBalance INT, " +
"CardLastTransaction INT, " +
"PRIMARY KEY (CardId, UpdateTime)" +
Integer.toString(nfcCardData.getUniqueId()),
Long.toString(nfcCardData.getLastUpdate())
};
- Cursor resultSet = database.rawQuery("SELECT CardData FROM NfcCardStore WHERE CardId = ? AND UpdateTime = ?", whereArgs);
+ Cursor resultSet = database.rawQuery("SELECT CardBalance FROM NfcCardStore WHERE CardId = ? AND UpdateTime = ?", whereArgs);
if(resultSet.moveToFirst()) {
- if(resultSet.getString(0).equalsIgnoreCase(nfcCardData.getCardData()))
- return;
try {
ContentValues updateValues = new ContentValues();
- updateValues.put("CardData", nfcCardData.getCardData());
updateValues.put("CardBalance", nfcCardData.getBalance());
updateValues.put("CardLastTransaction", nfcCardData.getLastTransaction());
ContentValues indexValues = new ContentValues();
indexValues.put("CardId", nfcCardData.getUniqueId());
indexValues.put("UpdateTime", nfcCardData.getLastUpdate());
- indexValues.put("CardData", nfcCardData.getCardData());
indexValues.put("CardBalance", nfcCardData.getBalance());
indexValues.put("CardLastTransaction", nfcCardData.getLastTransaction());
String[] whereArgs = {
Integer.toString(lastLimit)
};
- resultSet = database.rawQuery("SELECT CardId,UpdateTime,CardData,CardBalance,CardLastTransaction FROM NfcCardStore ORDER BY UpdateTime DESC LIMIT ?", whereArgs);
+ resultSet = database.rawQuery("SELECT CardId,UpdateTime,CardBalance,CardLastTransaction FROM NfcCardStore ORDER BY UpdateTime DESC LIMIT ?", whereArgs);
} else
- resultSet = database.rawQuery("SELECT CardId,UpdateTime,CardData,CardBalance,CardLastTransaction FROM NfcCardStore ORDER BY UpdateTime DESC", null);
+ resultSet = database.rawQuery("SELECT CardId,UpdateTime,CardBalance,CardLastTransaction FROM NfcCardStore ORDER BY UpdateTime DESC", null);
ArrayList<NfcCardData> nfcCardDatas = new ArrayList<NfcCardData>();
if(resultSet.moveToFirst()) {
do {
- NfcCardData nfcCardData = new NfcCardData(resultSet.getInt(0), resultSet.getLong(1), resultSet.getString(2), resultSet.getInt(3), resultSet.getInt(4));
+ NfcCardData nfcCardData = new NfcCardData(resultSet.getInt(0), resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3));
nfcCardDatas.add(nfcCardData);
} while (resultSet.moveToNext());
}