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=?";