//数量
@SuppressWarnings("unchecked")
public Integer findChildren(String code) {
Criteria c = this.createCriteria();
c.add(Restrictions.eq("status",
Integer.valueOf(Constants.NOTICE_MAIL_STATUS.receive.getIndex())));
c.add(Restrictions.like("code", code, MatchMode.START));
c.add(Restrictions.ne("code", code));
c.addOrder(Order.asc("seq"));
return (Integer) c.list().size();
}
//列表
public List<DeviceVideoMidtable> getVideoFunList(Integer deviceId, Integer type) {
Criteria c = createCriteria(Restrictions.eq("deviceId", deviceId));
c.add(Restrictions.eq("type", type));
c.add(Restrictions.eq("status", Constants.TB_STATUS.normal.getIndex()));
return c.list();
}
//单个对象
@SuppressWarnings("unchecked")
public CarFlow getVideoFunList( String type,String name,Date createTime) {
Criteria c = createCriteria(Restrictions.eq("type", type));
c.add(Restrictions.eq("type", type));
// c.add(Restrictions.eq("status", Constants.TB_STATUS.normal.getIndex()));
return (CarFlow) c.uniqueResult();
}
hibernate 下 Criteria c 列表,数量,单个 的使用方法
最新推荐文章于 2023-07-30 01:00:52 发布