String hql = "from Items oi "
+ " where exists "
+ "( select 1 from Nodes n where oi.cId = n.cId and n.nodeId= ? )";
List params = new ArrayList();
params.add(nodeId);//固定参数信息
//组拼查询的 检验项目串
if(null != existsItems && !"".equals(existsItems)){
StringBuffer strbuf = new StringBuffer();
strbuf.append(" and oi.ItemId not in ( ");//组成新的查询条件
String[] items = existsItems.split(",");
for(int i=0;i<=items.length-1;i++){
if(i != 0){
strbuf.append(" , ");
}
strbuf.append(" ? ");//动态添加参数
params.add(items[i]);//同步添加变量
}
strbuf.append(" )");
hql += strbuf.toString();
}
List<Items> list = findListByHQL(hql, params); node