| | |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public List<HotSearchAdmin> getHotSearchAdmin(String key, int detailSystem, int page) { |
| | | public List<HotSearchAdmin> getHotSearchAdmin(String key, String systemId, int detailSystem, int page) { |
| | | List<HotSearchAdmin> zhiBoClassList = new ArrayList<>(); |
| | | try { |
| | | List<DetailSystem> detailSystemList = detailSystemDao.list("from DetailSystem"); |
| | | List<DetailSystem> detailSystemList = detailSystemDao.list("from DetailSystem ds where ds.system.id=" + systemId); |
| | | String sql = ""; |
| | | if (detailSystem > 0) |
| | | sql = "select sh.hotSearch from SuperHotSearch sh where sh.hotSearch.name like ? and sh.detailSystem.id=" |
| | | + detailSystem + " order by sh.createtime desc"; |
| | | else |
| | | sql = "from HotSearch zb where zb.name like ? order by zb.createtime desc"; |
| | | sql = "from HotSearch zb where zb.name like ? and zb.system.id=" + systemId + " order by zb.createtime desc"; |
| | | |
| | | List<HotSearch> list = hotSearchDao.list(sql, (page - 1) * Constant.pageCount, Constant.pageCount, |
| | | new Serializable[]{"%" + key + "%"}); |
| | |
| | | return zhiBoClassList; |
| | | } |
| | | |
| | | public long getHotSearchAdminCount(String key, int detailSystem) { |
| | | public long getHotSearchAdminCount(String key,String systemId, int detailSystem) { |
| | | String sql = ""; |
| | | if (detailSystem > 0) |
| | | sql = "select count(*) from (select count(*) from wk_video_super_hotsearch zb left join wk_video_hotsearch c on c.id=zb.hotsearchid where zb.detailsystem=" |
| | | + detailSystem + " and c.name like '%" + key + "%' group by zb.hotsearchid) s"; |
| | | else |
| | | sql = "select count(*) from wk_video_hotsearch h where h.name like '%" + key + "%'"; |
| | | sql = "select count(*) from wk_video_hotsearch h where h.name like '%" + key + "%' and h.system="+systemId; |
| | | |
| | | return videoBanQuanVideoDao.getCountSQL(sql); |
| | | } |