package com.tool.applockpro.data;

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

import java.util.List;

@Dao
public interface Mydao {
    @Insert
    void insertAll(List<Mydata> myDataList);

    @Query("SELECT * FROM lock_table WHERE isLock = :islock")
    List<Mydata> getlockapp(boolean islock);

    @Query("SELECT * FROM lock_table WHERE system = :issystem")
    List<Mydata> getappissystem(boolean issystem);

    @Query("SELECT * FROM lock_table WHERE packageName = :packagename")
    Mydata getappislock(String packagename);

    @Query("SELECT * FROM lock_table WHERE appName LIKE '%' || :appName || '%'")
    LiveData<List<Mydata>> getSearchData(String appName);
    @Query("SELECT * FROM lock_table WHERE appName LIKE '%' || :appName || '%'")
    List<Mydata> getSearchDatas(String appName);
    @Query("SELECT * FROM lock_table ")
    List<Mydata> getAllapp();

    @Update
    void update(Mydata myData);

    @Query("SELECT * FROM lock_table WHERE isLock = :islock")
    LiveData<List<Mydata>> getLockApps(boolean islock);

    @Query("SELECT * FROM lock_table WHERE system = :issystem")
    LiveData<List<Mydata>> getAppsBySystem(boolean issystem);

    @Query("SELECT * FROM lock_table")
    LiveData<List<Mydata>> getAllApps();

}
