按时间查询和关键字查询,该如何解决
按时间查询和关键字查询
以上是Restrictions 写的按关键字查询,现在增加按关键字查询,该怎么写
------解决方案--------------------
------解决方案--------------------
呵呵,解决了就好~,遇到问题要静下心了,从头想想。
- Java code
public Page<AdTesify> getPage(Page<AdTesify> page, String searchKey,int flowStatus){ Criterion cri; if(flowStatus==-1) { cri =Restrictions.like(AdTesify.Pro_Content, searchKey, MatchMode.ANYWHERE); } else{ cri = Restrictions.and(Restrictions.like(AdTesify.Pro_Content, searchKey, MatchMode.ANYWHERE), Restrictions.eq(AdTesify.Pro_FlowStatus, flowStatus) ); } return adTesifyDao.findPage(page,cri); }
以上是Restrictions 写的按关键字查询,现在增加按关键字查询,该怎么写
------解决方案--------------------
------解决方案--------------------
呵呵,解决了就好~,遇到问题要静下心了,从头想想。