package com.example.applock.roombase;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;
@Dao
public interface AppEntityDao {

    @Query("select * from app_table_name where apppackageName=:apppackageName")
    AppEntity queryByPagName(String apppackageName);
    @Query("SELECT * FROM app_table_name WHERE apppackageName LIKE '%' || :apppackageName || '%' ")
    List<AppEntity> QueryByInputName(String apppackageName);

    @Update
    void updateData(AppEntity entityApp);

    @Insert(onConflict = OnConflictStrategy.IGNORE)
    void insertData(AppEntity entityApp);

    @Query("select * from app_table_name where applocked=:isLock")
    LiveData<List<AppEntity>> queryApp(boolean isLock);


    @Query("select * from app_table_name where applocked=:isLock")
   List<AppEntity> queryLockApp(boolean isLock);
    @Query("select * from app_table_name where appfrom=:appfrom")
    List<AppEntity> queryApplfrom(boolean appfrom);
}
