自定义追加查询条件之OR
//查询条件组装器org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, tpmEquipmentInfo, request.getParameterMap());
try{
//自定义追加查询条件
if(null != testID && !"".equals(testID) && !"null".equals(testID)){
System.out.println(testID);
cq.eq("stovecodeId", testID) or cq.eq("useDepartmentId", testID) or cq.eq("useLocationId", testID);
}
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
想要追加这个:cq.eq("stovecodeId", testID) or cq.eq("useDepartmentId", testID) or cq.eq("useLocationId", testID);该怎么写?求解
解决了解决了,哈哈:
cq.add(Restrictions.or(Restrictions.eq("stovecodeId",testID),Restrictions.or(Restrictions.eq("useDepartmentId",testID), Restrictions.eq("useLocationId",testID))));
:D:D:D
页:
[1]