Service
Dao
Criterion c1 = Restrictions.eq("diprojectId", projectId);
Criterion c2 = Restrictions.in("digroupId", groupId);
Criterion c3 = Restrictions.eq("divalid", Const_val.C_INT_VALID);
List<TbDeviceInfo> deviceInfoList = deviceInfoDao.findAvlByProIdAndGroupId(projectId, groupId, c1, c2, c3);
Dao
public List<TbDeviceInfo> findAvlByProIdAndGroupId(Integer projectId, Collection<Integer> groupId, Criterion... c)
DetachedCriteria criteria = DetachedCriteria.forClass(TbDeviceInfo.class);
for (Criterion criterion : c) {
criteria.add(criterion);
}
List<TbDeviceInfo> results = getHibernateTemplate().findByCriteria(criteria);