/** * 查询用户的附加信息 * * @param key * @param userId * @return */ public SocialUserAccountInfo findUserOfInfoByKey(String key, String userId) { SocialUserAccountInfoQuery query = new SocialUserAccountInfoQuery(); query.setKey(key).setUserId(userId); List<SocialUserAccountInfo> list = findSocialUserAccountInfoByQueryCriteria(query, null); if (list != null && list.size() > 0) { return list.get(0); } return null; }
/** * 查询今天登录的用户的帐号信息 * * @return */ public List<SocialUserAccountInfo> queryTodayLoginSocialUserAccountInfo() { SocialUserAccountInfoQuery query = new SocialUserAccountInfoQuery(); Date d = new Date(); Date aDate = StringDateUtil.dateToYMD(d); query.setDateAfter(aDate); query.setType(DictDef.dict("user_info_type")); query.setKey("user_last_logged_time"); query.setOrderBy("value_date_ asc"); // 查询今天登录的用户 List<SocialUserAccountInfo> list = findSocialUserAccountInfoByQueryCriteria(query, null); return list; }
private SocialUserAccountInfo queryExist(SocialUserAccountInfo socialUserAccountInfo) { SocialUserAccountInfoQuery query = new SocialUserAccountInfoQuery(); query .setKey(socialUserAccountInfo.getKey()) .setAccountId(socialUserAccountInfo.getAccountId()) .setType(socialUserAccountInfo.getType()) .setUserId(socialUserAccountInfo.getUserId()) .setEntityId(socialUserAccountInfo.getEntityId()); List<SocialUserAccountInfo> infos = findSocialUserAccountInfoByQueryCriteria(query, null); if (infos != null && infos.size() > 0) { return infos.get(0); } return null; }