Browse Source

feat: 👍 使用check_date 倒序排列

master
niushuai233 1 year ago
parent
commit
f7b45d5f82
  1. 6
      app/src/main/java/cc/niushuai/didicheck/biz/dao/CheckRecordDao.java
  2. 2
      app/src/main/java/cc/niushuai/didicheck/ui/main/home/HomeRecycleViewAdapter.java

6
app/src/main/java/cc/niushuai/didicheck/biz/dao/CheckRecordDao.java

@ -14,14 +14,14 @@ import io.reactivex.Flowable; @@ -14,14 +14,14 @@ import io.reactivex.Flowable;
@Dao
public interface CheckRecordDao {
@Query("SELECT * FROM t_check_record order by check_date desc")
@Query("SELECT * FROM t_check_record order by check_date desc, create_date desc")
Flowable<List<CheckRecord>> listAll();
@Query("select * from t_check_record where deleted = 0 and check_date = :date order by check_date desc")
@Query("select * from t_check_record where deleted = 0 and check_date = :date order by check_date desc, create_date desc")
Flowable<List<CheckRecord>> queryByDate(long date);
@Query("select * from t_check_record where deleted = 0 and create_date >= :startDate and create_date <= :endDate order by check_date desc")
@Query("select * from t_check_record where deleted = 0 and create_date >= :startDate and create_date <= :endDate order by check_date desc, create_date desc")
Flowable<List<CheckRecord>> queryByDate(long startDate, long endDate);

2
app/src/main/java/cc/niushuai/didicheck/ui/main/home/HomeRecycleViewAdapter.java

@ -46,7 +46,7 @@ public class HomeRecycleViewAdapter extends RecyclerView.Adapter<HomeRecycleView @@ -46,7 +46,7 @@ public class HomeRecycleViewAdapter extends RecyclerView.Adapter<HomeRecycleView
public void onBindViewHolder(@NonNull HomeRecycleViewHolder holder, int position) {
CheckRecord checkRecord = checkRecordList.get(position);
holder.titleTextView.setText(checkRecord.getName());
holder.contentTextView.setText(DateUtil.formatDateTime(new Date(checkRecord.getCreateDate())));
holder.contentTextView.setText(DateUtil.formatDate(new Date(checkRecord.getCheckDate())));
}
@Override

Loading…
Cancel
Save