detachedCriteria.add(Restrictions.eq("user.userId", userId));
Restrictions.eq()是等于,Restrictions.allMap()使用Map,使用key和value进行多个等于的对比
Restrictions.gt()大于,Restrictions.ge()大于等于,Restrictions.lt()小于,
Restrictions.le()小于等于,Restrictions.between()对应sql中的between字句,
Restrictions.like()对应sql的like字句,
Restrictions.in()对应sql的in字句
Restrictions.and()
Restrictions.or()
Restrictions.sqlRestnction(),是对sql限定查询