Commit fa1798d310795d4bee1fce60bfea28dab36ac806
1 parent
006e6b6d
修改页面上我的已审bug
Showing
1 changed file
with
16 additions
and
8 deletions
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| @@ -125,34 +125,42 @@ public class VideosServiceImpl { | @@ -125,34 +125,42 @@ public class VideosServiceImpl { | ||
| 125 | e.printStackTrace(); | 125 | e.printStackTrace(); |
| 126 | } | 126 | } |
| 127 | criteria.andGreaterThanOrEqualTo("video_upload_time", startdate); | 127 | criteria.andGreaterThanOrEqualTo("video_upload_time", startdate); |
| 128 | + criteria2.andGreaterThanOrEqualTo("video_upload_time", startdate); | ||
| 128 | criteria.andLessThanOrEqualTo("video_upload_time", enddate); | 129 | criteria.andLessThanOrEqualTo("video_upload_time", enddate); |
| 130 | + criteria2.andLessThanOrEqualTo("video_upload_time", enddate); | ||
| 129 | } | 131 | } |
| 130 | if (CommonUtils.isNotEmpty(video_title)) { | 132 | if (CommonUtils.isNotEmpty(video_title)) { |
| 131 | criteria.andLike("video_title", "%" + video_title + "%"); | 133 | criteria.andLike("video_title", "%" + video_title + "%"); |
| 134 | + criteria2.andLike("video_title", "%" + video_title + "%"); | ||
| 132 | } | 135 | } |
| 133 | - if (CommonUtils.isNotNull(state) && state == 0) { | ||
| 134 | - criteria.andEqualTo("state", state); | ||
| 135 | - } else if (CommonUtils.isNotNull(state) && state == 1) { | ||
| 136 | - criteria.andEqualTo("state", state); | ||
| 137 | - criteria2.andEqualTo("state", 2); | ||
| 138 | - example.or(criteria2); | ||
| 139 | - } | 136 | + |
| 140 | if (CommonUtils.isNotEmpty(video_priority)) { | 137 | if (CommonUtils.isNotEmpty(video_priority)) { |
| 141 | criteria.andEqualTo("video_priority", video_priority); | 138 | criteria.andEqualTo("video_priority", video_priority); |
| 139 | + criteria2.andEqualTo("video_priority", video_priority); | ||
| 142 | } | 140 | } |
| 143 | if (CommonUtils.isNotNull(spid)) { | 141 | if (CommonUtils.isNotNull(spid)) { |
| 144 | criteria.andEqualTo("spid", spid); | 142 | criteria.andEqualTo("spid", spid); |
| 143 | + criteria2.andEqualTo("spid", spid); | ||
| 145 | } | 144 | } |
| 146 | if (CommonUtils.isNotNull(receive)) { | 145 | if (CommonUtils.isNotNull(receive)) { |
| 147 | criteria.andEqualTo("receive", receive); | 146 | criteria.andEqualTo("receive", receive); |
| 147 | + criteria2.andEqualTo("receive", receive); | ||
| 148 | if (receive == true) { | 148 | if (receive == true) { |
| 149 | criteria.andEqualTo("receive_user_id", userId); | 149 | criteria.andEqualTo("receive_user_id", userId); |
| 150 | + criteria2.andEqualTo("receive_user_id", userId); | ||
| 150 | } | 151 | } |
| 151 | } | 152 | } |
| 153 | + if (CommonUtils.isNotNull(state) && state == 0) { | ||
| 154 | + criteria.andEqualTo("state", state); | ||
| 155 | + } else if (CommonUtils.isNotNull(state) && state == 1) { | ||
| 156 | + criteria.andEqualTo("state", state); | ||
| 157 | + criteria2.andEqualTo("state", 2); | ||
| 158 | + example.or(criteria2); | ||
| 159 | + } | ||
| 152 | //默认按上传时间倒序排序 | 160 | //默认按上传时间倒序排序 |
| 153 | example.setOrderByClause("video_upload_time desc"); | 161 | example.setOrderByClause("video_upload_time desc"); |
| 154 | PageHelper.startPage(page, pageSize, true); | 162 | PageHelper.startPage(page, pageSize, true); |
| 155 | - logger.info("example:"+example); | 163 | + logger.info("example{}:"+example); |
| 156 | List<ShyVideos> shyVideosList = shyVideosMapper.selectByExample(example); | 164 | List<ShyVideos> shyVideosList = shyVideosMapper.selectByExample(example); |
| 157 | PageInfo<ShyVideos> pageInfo = new PageInfo<>(shyVideosList); | 165 | PageInfo<ShyVideos> pageInfo = new PageInfo<>(shyVideosList); |
| 158 | return pageInfo; | 166 | return pageInfo; |