| | |
| | | ht.setIosControl(obj[6] + ""); |
| | | ht.setNumber(Integer.parseInt(obj[7] + "")); |
| | | ht.setRefreshPosition(Integer.parseInt(obj[25] + "")); |
| | | ht.setMoreTag(obj[26]+""); |
| | | ht.setMoreTag(obj[26] + ""); |
| | | |
| | | |
| | | ht.setOrderby(obj[21] + ""); |
| | |
| | | hv.setId(obj[8] + ""); |
| | | hv.setPicture(obj[10] + ""); |
| | | hv.setTag(obj[11] + ""); |
| | | hv.setBigPicture(Integer.parseInt(obj[24] + "")>0); |
| | | hv.setBigPicture(Integer.parseInt(obj[24] + "") > 0); |
| | | |
| | | VideoInfo video = new VideoInfo(); |
| | | video.setId(obj[12] + ""); |
| | |
| | | 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 { |