package com.secspace.lib.common.function.database.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import com.secspace.lib.common.function.model.UseApp;

import java.util.List;

@Dao
public interface UseAppDao {

    @Query("select * from use_app")
    List<UseApp> queryAll();

    @Query("select * from use_app where upload_time = 0")
    List<UseApp> queryNoupload();

    @Query("select * from use_app where app_package = :packageName")
    UseApp queryByPkg(String packageName);

    @Insert
    long insertTargetApp(UseApp targetApp);

    @Insert
    List<Long> insertTargetApps(List<UseApp> targetApps);

    @Update
    void updateTargetApp(UseApp targetApp);

    @Update
    void updateTargetApps(List<UseApp> targetApps);
}
