| | |
| | | return homeTypeList; |
| | | } |
| | | |
| | | @Cacheable(value = "homeCache", key = "'getHomeTypeList'+'-'+#detailSystem+'-'+#version+'-'+#dataKey+'-'+#page+'-'+#pageSize") |
| | | public List<HomeType> getHomeTypeList(String detailSystem, int version, String dataKey, int page, int pageSize) { |
| | | return homeTypeDao.list("select sht.homeType from SuperHomeType sht where sht.detailSystem.id=? and sht.homeType.specialDataKey=? order by sht.homeType.orderby DESC,sht.homeType.createtime DESC", (page - 1) * pageSize, pageSize, new Serializable[]{detailSystem, dataKey}); |
| | | } |
| | | |
| | | @Cacheable(value = "homeCache", key = "'countHomeType'+'-'+#detailSystem+'-'+#version+'-'+#dataKey") |
| | | public long countHomeType(String detailSystem, int version, String dataKey) { |
| | | return homeTypeDao.getCount("select count(*) from SuperHomeType sht where sht.detailSystem.id=? and sht.homeType.specialDataKey=?", new Serializable[]{detailSystem, dataKey}); |
| | | } |
| | | |
| | | |
| | | private void orderByType(List<HomeType> homeTypeList) { |
| | | Collections.sort(homeTypeList, new Comparator<HomeType>() { |
| | | public int compare(HomeType o1, HomeType o2) { |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | private int index(List<HomeType> list, HomeType ht) { |
| | | if (list == null) |
| | |
| | | } |
| | | |
| | | |
| | | public List<HomeVideo> getHomeVideoList(String homeId, List<Long> resourceIds, Boolean bigPicture, int page, int pageSize) { |
| | | @Cacheable(value = "homeCache", key = "'getHomeVideoList-'+#homeId+'-'+#resourceKey+'-'+#bigPicture+'-'+#page+'-'+#pageSize") |
| | | public List<HomeVideo> getHomeVideoList(String homeId, String resourceKey, List<Long> resourceIds, Boolean bigPicture, int page, int pageSize) { |
| | | List<HomeVideo> homeVideos = (List<HomeVideo>) homeVideoDao.excute(new HibernateCallback<List<HomeVideo>>() { |
| | | @Override |
| | | public List<HomeVideo> doInHibernate(Session session) throws HibernateException { |
| | |
| | | return homeVideos; |
| | | } |
| | | |
| | | |
| | | public long getHomeVideoListCount(String homeId, List<Long> resourceIds, Boolean bigPicture) { |
| | | @Cacheable(value = "homeCache", key = "'getHomeVideoListCount'+'-'+#resourceKey+'-'+#bigPicture") |
| | | public long getHomeVideoListCount(String homeId, String resourceKey, List<Long> resourceIds, Boolean bigPicture) { |
| | | return (Long) homeVideoDao.excute(new HibernateCallback<Long>() { |
| | | @Override |
| | | public Long doInHibernate(Session session) throws HibernateException { |