From 632886f2b10bbe601f3fbfdaa51f33f473bd3b53 Mon Sep 17 00:00:00 2001 From: pybple5kv <1766872402@qq.com> Date: Sun, 10 Jul 2022 22:19:23 +0800 Subject: [PATCH] ADD file via upload --- LoveDao.java | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 LoveDao.java diff --git a/LoveDao.java b/LoveDao.java new file mode 100644 index 0000000..748335e --- /dev/null +++ b/LoveDao.java @@ -0,0 +1,47 @@ +package com.example; + + +import com.example.bean.QuestBean; +import com.example.greendao.QuestBeanDao; + + + +public class LoveDao { + /** + * 添加数据 + * + * @param questBean + */ + public static void insertLove(QuestBean questBean) { + MyApplication.getDaoInstant().getQuestBeanDao().insertOrReplace(questBean); + } + + /** + * 删除数据 + * + * @param id + */ +// public static void deleteLove(long id) { +// MyApplication.getDaoInstant().getQuestBeanDao().deleteByKey(id); +// } + + /** + * 更新数据 + * + * @param shop + */ + public static void updateLove(QuestBean shop) { + MyApplication.getDaoInstant().getQuestBeanDao().update(shop); + } + + /** + * 查询条件为id=id的数据 + * + * @return + */ + public static QuestBean queryLove(String id) { + + return MyApplication.getDaoInstant().getQuestBeanDao().queryBuilder().where(QuestBeanDao.Properties.Id.eq(id)).list().get(0); + } + +}