in修改爲exists
一:in
hql +=" and b.newsid in (select f.object from FeedBack f where f.type=1 and f.operate=1 and f.userid in (select u.userid from SysUser u where f.userid = u.userid and u.username like '%"+filterValue+"%'))";
二:exist
hql +=" and exists (select f.object from FeedBack f where b.newsid = f.objectid and f.type=1 and f.operate=1 and exists (select u.userid from SysUser u where f.userid = u.userid and u.username like '%"+filterValue+"%'))";
第一個:select u.userid from SysUser u where f.userid = u.userid and u.username like '%"+filterValue+"%';
第二個:select f.object from FeedBack f where b.newsid = f.objectid and f.type=1 and f.operate=1
第三個:select b from PreNewsTips b where 1=1 ;
三:
hql += "select max(n.orders) from NewsIssueClassify n where parentid=?";