@Override public String getVisibleIds(String type) { StringBuffer sql = new StringBuffer(); sql.append("select t.id from T_LAWSANDREGULATIONS t where 1=1"); sql.append(" and PASS_AUDIT='" + LawsAndRegulations.PASS_AUDIT_YES + "'"); if (!StringUtil.isNullOrEmpty(type)) { sql.append(" and type = '").append(type).append("'"); } List<?> lawsList = queryBySql(sql.toString()); String queryIds = Util.spliceRangeIds(lawsList, null); return queryIds; }
@Override public List<InformationVo> listRecommended(Integer userId, int count) { //查询出被推荐的资源。并排除已被阅读的资源。 String sql = Util.getQueryRecommendedSqlStr("T_LAWSANDREGULATIONS", "READ_RECORD_LAWS", "LAWS_ID", userId, " and PASS_AUDIT='" + LawsAndRegulations.PASS_AUDIT_YES + "'", ""); Pagination page = queryBySql(1, count, sql); Long[] ids = Util.convertBigDecimalSet2LongList((Set<BigDecimal>) page.getSet()); List<InformationVo> infos = new ArrayList<InformationVo>(); if (ids.length > 0) { List<LawsAndRegulations> dataList = findByIds(ids); String viewAddress = Util.getDggSitePath() + "lawsAndRegulations/viewContent.do?id="; for (LawsAndRegulations laws : dataList) { InformationVo vo = new InformationVo(); vo.setReleaseTime(laws.getReleaseTime()); vo.setTitle(laws.getName()); vo.setType(Constants.BPM_ITEM_LAWS); vo.setViewAddress(viewAddress + laws.getId()); infos.add(vo); } } return infos; }