admin
2021-04-03 32d6c2ea8039b4771fd6b1ded8b022733e32352f
src/main/java/com/yeshi/buwan/service/imp/HomeTypeService.java
@@ -203,6 +203,17 @@
        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) {
@@ -210,6 +221,7 @@
            }
        });
    }
    private int index(List<HomeType> list, HomeType ht) {
        if (list == null)
@@ -353,7 +365,8 @@
    }
    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 {
@@ -383,8 +396,8 @@
        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 {