criteria中or
criteria.add(Restrictions.or(Restrictions.eq("woId",workOrderQueryReq.getDemolitionOrderId())));
String tel = customerQueryReq.getCallNumber();
// String sql = "cust_Id in ( select cust_id from address where cust_mobile = ‘"+customerQueryReq.getCallNumber()+"‘)";
// String sql = "cust_Id in ( select cust_id from address where cust_mobile = ‘"+tel+"‘ or contact_tel = ‘"+tel
// +"‘ or addr_message_mobile = ‘"+tel+"‘ or addr_bind_phone = ‘"+tel+"‘)";
// c.add(Restrictions.or(Restrictions.sqlRestriction(sql),Restrictions.eq("custMobile", customerQueryReq.getCallNumber())));
String sql = "CUST_MOBILE = ‘"+tel+"‘ or UNIT_TEL = ‘"+tel+"‘)";
c.add(Restrictions.sqlRestriction(sql));
原文:https://www.cnblogs.com/flymili1017/p/11088556.html