Hibernate不區分大小查詢函數(lower)

需求:英文模糊查詢狀態,不區分大小寫app

 

  
  
  
  
  1. //查詢語句 
  2.             hql.append("from TripBusAppoinInfo busAppoin where (1=1)"); 
  3.             //設置查詢條件 
  4.             if(!name.equals("")){ 
  5.                 hql.append("and lower(busAppoin.busAppoinName) like lower(?) "); 
  6.                 param.add("%"+name+"%"); 
  7.             } 
  8.             if(!cardNber.equals("")){ 
  9.                 hql.append("and busAppoin.busAppoinMemberNumber = ? "); 
  10.                 param.add(cardNber); 
  11.             } 
  12.             hql.append(" Order by busAppoin.busAppoinTime");//排序條件
相關文章
相關標籤/搜索