1.当条件中有and和or时
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("shopId",storeSn));
criteria.add(Restrictions.or(Restrictions.or(Restrictions.like("p.sn","%"+keyword().trim()+"%"),Restrictions.like(shopId","%"+keyword().trim()+"%")),Restrictions.like("name","%"+pagekeyword().trim()+"%")));
2.当条件为判断给定的字符串是否是数据库中字段的某个元素时
criteria.add(Restrictions.sql("FIND_IN_SET("+cId+",categoryPath)"));