我想做个组合查询,界面有好多文本框,输入值后点击“查询”,最好有具体的代码?谢谢各位了?
我用的是JPA。。。。
/**
* 根据Http服务注册ID和“入参”或“出参”标识,获取Http服务操作(参数)列表
* @param httpsrvregid
* @param inOrOut
* @return List<P_IRE_HttpSrvOpReg>
*/
@Override
public List<P_IRE_HttpSrvOpReg> getHttpSrvOpByHttpSrvRegId(
String httpsrvregid, String inOrOut, String operationTypeId) {
if (em == null) {
init();
}
Query query = em
.createQuery("SELECT x FROM P_IRE_HttpSrvOpReg x WHERE"
+ " x.httpsrvreg.httpsrvregid = :httpsrvregid and x.paramcatalog = :paramcatalog and x.operationtype.operationtypeid = :operationtypeid and dr=0 ");
query.setParameter("httpsrvregid", httpsrvregid);
query.setParameter("paramcatalog", inOrOut);
query.setParameter("operationtypeid", operationTypeId);
@SuppressWarnings("unchecked")
List<P_IRE_HttpSrvOpReg> listobj = query.getResultList();
return listobj;
}