@Insert
fun insertCategory(item:Category):Long
@Insert
fun insertCategorys(item:List<Category>):List<Long>
@Query("select * from Category")
fun queryCategory():List<Category>
@Query("select * from Category where type = (:type)")
fun queryCategoryByType(type:Int):List<Category>
@Query("select * from Category where title like '%' ||:type ||'%'")
fun queryCategoryByTagStr(type:String):List<Category>
@Dao
interface DailyRecordDao {
@Insert
fun insertRecords(item:List<RecordItemInfo>):List<Long>
@Insert
fun insertRecord(item:RecordItemInfo):Long
@Transaction
@Query("select * from RecordItemInfo")
fun queryRecord():List<RecordAndCategory>
@Transaction(这个注解是因为有关联表)
@Query("select * from RecordItemInfo where date = (:date)")
fun queryRecordByDate(date:Date):List<RecordAndCategory>
@Transaction
@Query("select * from RecordItemInfo where date > (:startMonth) and date < (:endMonth)")
fun queryRecordByMonth(startMonth:Date,endMonth:Date):List<RecordAndCategory>
@Transaction
@Query("select * from RecordItemInfo where categoryId in (:categoryIds)")
fun queryRecordByCategoryIds(categoryIds:List<Int>):List<RecordAndCategory>
@Transaction
@Query("select * from RecordItemInfo where money >= (:money)")
fun queryRecordByMoney(money:Double):List<RecordAndCategory>
}