You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.0 KiB
48 lines
1.0 KiB
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);
|
|
}
|
|
|
|
}
|