From c6c5a8ce0f42d46ea2fe0312c9eda67a49fd3917 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 01 二月 2021 18:58:21 +0800 Subject: [PATCH] 完善根据IP屏蔽广告,创建会员实体 --- src/main/java/com/yeshi/buwan/dao/base/BaseDao.java | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/dao/base/BaseDao.java b/src/main/java/com/yeshi/buwan/dao/base/BaseDao.java index 2c1332d..e81d1fc 100644 --- a/src/main/java/com/yeshi/buwan/dao/base/BaseDao.java +++ b/src/main/java/com/yeshi/buwan/dao/base/BaseDao.java @@ -59,6 +59,13 @@ return (List<T>) hibernateTemplate.find(hql, params); } + public T findOne(String hql, Serializable... params) { + List<T> list = (List<T>) hibernateTemplate.find(hql, params); + if (list != null && list.size() > 0) + return list.get(0); + return null; + } + @SuppressWarnings({"unchecked", "rawtypes"}) public List<T> list(String hql, final int start, final int count, final Serializable[] params) { final String tempsql = hql; -- Gitblit v1.8.0