admin
2021-03-06 7804263c6061aef813f0db27cb3046f746572606
src/main/java/com/yeshi/buwan/service/imp/ClassService.java
@@ -7,6 +7,7 @@
import javax.annotation.Resource;
import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService;
import com.yeshi.buwan.service.inter.video.VideoInfoExtraService;
import org.hibernate.CacheMode;
import org.hibernate.HibernateException;
import org.hibernate.Session;
@@ -36,8 +37,9 @@
    private VideoInfoDao videoInfoDao;
    @Resource
    private SuperVideoTypeDao superVideoTypeDao;
    @Resource
    private VideoResourceMapExtraInfoService videoResourceMapExtraInfoService;
    private VideoInfoExtraService videoInfoExtraService;
    public List<VideoType> getTypeList() {
        List<VideoType> list = videoTypeDao.list("from VideoType v where v.show='1' and v.parent=null");
@@ -234,7 +236,7 @@
        if (StringUtil.isNullOrEmpty(type)) {
            return getVideoInfoData(videoInfoDao.sqlList(
                    "select v.id,v.`name`,v.`tag`,v.`picture`,v.`hpicture`,v.`latest_hpicture`,v.watchcount,v.commentcount from wk_video_video v INNER JOIN  (SELECT  DISTINCT(v.id) FROM wk_category_video ca LEFT JOIN wk_video_video v ON v.id= ca.videoid LEFT JOIN wk_resource_video rv ON rv.`videoid`= v.`id`  AND( ? ) WHERE v.show= 1 and ca.id is not null AND rv.`resourceid` IS NOT NULL ? ) a using(id)",
                    (page - 1) * pageCount, pageCount, new Serializable[]{resourceWhere, orderby,}),resourceList);
                    (page - 1) * pageCount, pageCount, new Serializable[]{resourceWhere, orderby,}), resourceList);
        }
        List<VideoInfo> list = new ArrayList<VideoInfo>();
@@ -264,7 +266,7 @@
        });
        System.out.println("查询SQL费时:" + (System.currentTimeMillis() - startTime));
        return getVideoInfoData(list,resourceList);
        return getVideoInfoData(list, resourceList);
    }
    public List<VideoInfo> getVideoInfoData(List list, List<Long> resourceIdList) {
@@ -293,7 +295,7 @@
            dataList.add(info);
        }
        dataList = videoResourceMapExtraInfoService.batchExtraInfo(dataList, resourceIdList);
        dataList = videoInfoExtraService.batchExtra(dataList, resourceIdList);
        return dataList;
    }
@@ -579,7 +581,7 @@
     */
    @SuppressWarnings("unchecked")
    public List<com.yeshi.buwan.domain.web.VideoTypeAdmin> getVideoTypeAdmin(final int detailSystem, final int pid,
    public List<com.yeshi.buwan.domain.web.VideoTypeAdmin> getVideoTypeAdmin(final String systemId, final int detailSystem, final int pid,
                                                                             final int page) {
        return (List<com.yeshi.buwan.domain.web.VideoTypeAdmin>) videoTypeDao
                .excute(new HibernateCallback<List<com.yeshi.buwan.domain.web.VideoTypeAdmin>>() {
@@ -587,7 +589,7 @@
                            throws HibernateException {
                        List<com.yeshi.buwan.domain.web.VideoTypeAdmin> hotTypeList = new ArrayList<com.yeshi.buwan.domain.web.VideoTypeAdmin>();
                        try {
                            List<DetailSystem> detailSystemList = session.createQuery("from DetailSystem").list();
                            List<DetailSystem> detailSystemList = session.createQuery("from DetailSystem ds where ds.system.id=" + systemId).list();
                            String where = "";
                            List<VideoType> list = null;