@Transactional
public PageConf findFriendPageList(int start, int limit, Map map)
throws FriendException {
try {
UserInfo userInfo = (UserInfo) map.get("userInfo");
map.remove("userInfo");
String hql = " select module from UserInfo module ";
// 通用查询匹配
Object[] values = CommonDaoUtil.commonQuery(map);
hql += values[0].toString();
// Object[]需要进行强制转换.
PageConf pageConf = baseDao.findPage(start, limit, hql,
(Object[]) values[1]);
if (pageConf != null && pageConf.getData() != null) {
List list = pageConf.getData();
for (int i = 0; i < list.size(); i++) {
UserInfo friendUser = (UserInfo) list.get(i);
System.out.println(userInfo.getId() + "/"
+ friendUser.getId());
String hql_2 = "select friend.status from Friend friend where friend.userId = ? and friend.friend.id = ? ";
Integer status = (Integer) baseDao.findFirstOne(hql_2,
userInfo.getId(), friendUser.getId());
friendUser.setMyFriendState(status);
System.out.println(status);
}
}
return pageConf;
} catch (Exception e) {