日期:2014-05-20 浏览次数:20817 次
String hql ="from TbUser u ,TbLetter l where u.userId = l.tbUserByFkFromId.userId and l.toIsDelete=1 and l.tbUserByFkToId.userId="+tbUser.userId+"order by l.letterIsRead desc , l.letterTime desc"; //查询 List result = userDao.query(pageNo, pageSize, hql.toString()); //执行更新操作:把所有未读的letter更新为已经读 if(null != result && 0 != result.size()) { hql =new StringBuffer(" update tb_letter set letter_is_read= 1 where letter_is_read=0 and fk_to_id =") ; hql.append(tbUser.getUserId()); userDao.excuteSql(hql.toString()); } return result ;