| | |
| | | resourceWhere = resourceWhere.substring(0, resourceWhere.length() - 2); |
| | | List resultList = session |
| | | .createSQLQuery( |
| | | "SELECT ht.`id` as htid,ht.`name` as htname,ht.`columns` as htcolumns ,ht.`hasmore`,ht.`activity` ,ht.`params` ,ht.`ioscontrol`,ht.number,hvideo.id as hvid,hvideo.`videoid` AS hvvideoid,hvideo.`picture`as hvpicture ,hvideo.`tag` as hvtag, v.`id` as vid ,v.`picture` as vpicture ,v.`name` as vname ,v.`tag` as vtag ,v.`hpicture` as vhpicture ,v.`latest_hpicture` as vlatest_hpicture ,v.`watchcount` as vwatchcount,v.commentcount,ht.icon as hicon,ht.orderby as htorder,hvideo.orderby as hvorder,need_ad,big_picture FROM (SELECT hv.* FROM `wk_resource_video` rv LEFT JOIN `wk_video_homevideo` hv ON rv.`videoid` =hv.`videoid` LEFT JOIN `wk_video_video` v ON v.`id` =hv.`videoid` LEFT JOIN `wk_video_banquan_video` bv ON bv.`videoid`=hv.`videoid` AND bv.`detailsystemid`=" |
| | | "SELECT ht.`id` as htid,ht.`name` as htname,ht.`columns` as htcolumns ,ht.`hasmore`,ht.`activity` ,ht.`params` ,ht.`ioscontrol`,ht.number,hvideo.id as hvid,hvideo.`videoid` AS hvvideoid,hvideo.`picture`as hvpicture ,hvideo.`tag` as hvtag, v.`id` as vid ,v.`picture` as vpicture ,v.`name` as vname ,v.`tag` as vtag ,v.`hpicture` as vhpicture ,v.`latest_hpicture` as vlatest_hpicture ,v.`watchcount` as vwatchcount,v.commentcount,ht.icon as hicon,ht.orderby as htorder,hvideo.orderby as hvorder,need_ad,big_picture,refresh_position,more_tag FROM (SELECT hv.* FROM `wk_resource_video` rv LEFT JOIN `wk_video_homevideo` hv ON rv.`videoid` =hv.`videoid` LEFT JOIN `wk_video_video` v ON v.`id` =hv.`videoid` LEFT JOIN `wk_video_banquan_video` bv ON bv.`videoid`=hv.`videoid` AND bv.`detailsystemid`=" |
| | | + detailSystem |
| | | + " AND bv.`show`=1 LEFT JOIN `wk_video_hometype` ht ON ht.id=hv.hometype WHERE (hv.`id`>0 AND v.`show` =1 AND ht.special_data_key='" |
| | | + dataKey + "' AND (" + resourceWhere |
| | | + " ) AND bv.`videoid` IS NULL ) GROUP BY (hv.`id`) ORDER BY hv.big_picture desc, hv.`orderby` desc,v.createtime DESC ) hvideo LEFT JOIN `wk_video_super_hometype` sht ON sht.`hometypeid`=hvideo.hometype LEFT JOIN `wk_video_hometype` ht ON sht.`hometypeid` =ht.`id` LEFT JOIN wk_video_video v ON v.`id`=hvideo.videoid WHERE sht.`detailsystemid` =" + detailSystem + " ORDER BY hvideo.`orderby` DESC,v.orderby desc,v.updatetime desc") |
| | | + " ) AND bv.`videoid` IS NULL ) GROUP BY (hv.`id`) ORDER BY hv.`orderby` desc,v.createtime DESC ) hvideo LEFT JOIN `wk_video_super_hometype` sht ON sht.`hometypeid`=hvideo.hometype LEFT JOIN `wk_video_hometype` ht ON sht.`hometypeid` =ht.`id` LEFT JOIN wk_video_video v ON v.`id`=hvideo.videoid WHERE sht.`detailsystemid` =" + detailSystem + " ORDER BY hvideo.big_picture desc, hvideo.`orderby` DESC,v.orderby desc,v.updatetime desc") |
| | | .list(); |
| | | List<HomeType> homeTypeList = new ArrayList<>(); |
| | | Map<String, Integer> homeTypeVideoCountMap = new HashMap<>(); |
| | |
| | | ht.setParams(obj[5] + ""); |
| | | ht.setIosControl(obj[6] + ""); |
| | | ht.setNumber(Integer.parseInt(obj[7] + "")); |
| | | ht.setRefreshPosition(Integer.parseInt(obj[25] + "")); |
| | | ht.setMoreTag(obj[26]+""); |
| | | |
| | | |
| | | ht.setOrderby(obj[21] + ""); |
| | |
| | | hv.setId(obj[8] + ""); |
| | | hv.setPicture(obj[10] + ""); |
| | | hv.setTag(obj[11] + ""); |
| | | hv.setBigPicture(Boolean.parseBoolean(obj[24] + "")); |
| | | hv.setBigPicture(Integer.parseInt(obj[24] + "")>0); |
| | | |
| | | VideoInfo video = new VideoInfo(); |
| | | video.setId(obj[12] + ""); |
| | |
| | | //计算已有大图数量 |
| | | int bigCount = 0; |
| | | for (HomeVideo hv1 : eHomeType.getHomeVideoList()) { |
| | | if (hv.getBigPicture()) { |
| | | if (hv1.getBigPicture()) { |
| | | bigCount++; |
| | | } |
| | | } |
| | |
| | | if (bigPicture != null) { |
| | | sql += " and hv.big_picture=" + (bigPicture ? 1 : 0); |
| | | } |
| | | sql += "GROUP BY hv.id ORDER BY hv.big_picture desc,hv.`orderby` DESC,hv.`createtime` DESC"; |
| | | sql += " GROUP BY hv.id ORDER BY hv.big_picture desc,hv.`orderby` DESC,hv.`createtime` DESC"; |
| | | |
| | | return session.createSQLQuery(sql).addEntity(HomeVideo.class).setFirstResult((page - 1) * pageSize).setMaxResults(pageSize).list(); |
| | | } |