1 CriteriaQuery cq = new CriteriaQuery(TSUser.class, dataGrid); 2 // 查询条件组装器 3 org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, user); 4 Restrictions.or(Restrictions.ilike("userName", searchValue, MatchMode.ANYWHERE), Restrictions.ilike("realName", searchValue, MatchMode.ANYWHERE)); 5 Restrictions.or(Restrictions.ilike("userOrgList.tsDepart.departname", searchValue, MatchMode.ANYWHERE), Restrictions.ilike("userKey", searchValue, MatchMode.ANYWHERE)); 6 Restrictions.or(Restrictions.ilike("userQuarters", searchValue, MatchMode.ANYWHERE), Restrictions.ilike("userWork", searchValue, MatchMode.ANYWHERE)); 7 cq.add(); 8 this.systemService.getDataGridReturn(cq, true); 9 TagUtil.datagrid(response, dataGrid);
无限添加or
1 List<TSUser> list = criteria.add(Restrictions.or(Restrictions.like("description", key,MatchMode.ANYWHERE), 2 Restrictions.or(Restrictions.like("name", key,MatchMode.ANYWHERE), 3 Restrictions.or(Restrictions.like("direct", key,MatchMode.ANYWHERE), 4 Restrictions.or(Restrictions.like("mainplay",key,MatchMode.ANYWHERE), 5 Restrictions.like("filearea", key,MatchMode.ANYWHERE)))))).list();