package com.dayu.qihealonelibrary.dao; 
 | 
  
 | 
import androidx.room.Dao; 
 | 
import androidx.room.Delete; 
 | 
import androidx.room.Insert; 
 | 
import androidx.room.OnConflictStrategy; 
 | 
import androidx.room.Query; 
 | 
import androidx.room.Update; 
 | 
  
 | 
import com.dayu.qihealonelibrary.dbBean.UserCardBean; 
 | 
  
 | 
import java.util.List; 
 | 
  
 | 
/** 
 | 
 * Copyright (C), 2023, 
 | 
 * Author: zuo 
 | 
 * Date: 2023-11-06 21:43 
 | 
 * Description: 
 | 
 */ 
 | 
@Dao 
 | 
public interface UserCardDao { 
 | 
    @Insert(onConflict = OnConflictStrategy.REPLACE) 
 | 
    void insert(UserCardBean passWord); 
 | 
  
 | 
    @Update 
 | 
    void update(UserCardBean passWord); 
 | 
  
 | 
    @Delete 
 | 
    void delete(UserCardBean passWord); 
 | 
  
 | 
    @Query("select  * from UserCardBean order by date desc") 
 | 
    List<UserCardBean> findAll(); 
 | 
  
 | 
    @Query("select  * from UserCardBean where date>=:beginTime and date<=:endTime") 
 | 
    List<UserCardBean> findByTime(long beginTime, long endTime); 
 | 
  
 | 
    @Query("select  * from UserCardBean where userName like :data or userID like :data or  phone like :data") 
 | 
    List<UserCardBean> findByData(String data); 
 | 
  
 | 
    @Query("select  * from UserCardBean order by date desc LIMIT :limit OFFSET :offset") 
 | 
    List<UserCardBean> findAll(int offset, int limit); 
 | 
  
 | 
    @Query("select COUNT(*) from UserCardBean") 
 | 
    int getUserTotale(); 
 | 
  
 | 
    @Query("select  * from UserCardBean where cardNumber =:data order by date desc") 
 | 
    List<UserCardBean> findUserName(String data); 
 | 
} 
 |