Commit 1add5911 authored by Quxl's avatar Quxl

修改审片检索条件

parent 1eab81a0
......@@ -50,18 +50,17 @@ public class UserReviewController {
@ApiImplicitParam(paramType = "query", dataType = "long", required = false, name = "index", value="分页页码"),
@ApiImplicitParam(paramType = "query", dataType = "long", required = false, name = "limit", value="分页大小"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "limitKey", value="分页排序", allowMultiple=true),
@ApiImplicitParam(paramType = "query", dataType = "date", required = false, name = "start_time", value="开始时间"),
@ApiImplicitParam(paramType = "query", dataType = "date", required = false, name = "end_time", value="结束时间"),
@ApiImplicitParam(paramType = "query", dataType = "date", required = false, name = "push_date", value="推送日期"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "film_type_name", value="影片类型"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "keyword", value="模糊匹配关键词"),
})
public Object getReviewList(Long index, Long limit, String[] limitKey, Date start_time, Date end_time, String film_type_name, String keyword) {
public Object getReviewList(Long index, Long limit, String[] limitKey, Date push_date, String film_type_name, String keyword) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
LoginToken loginToken = tokenService.getToken();
Long user_id = (Long)loginToken.getId();
Page page = new Page(index, limit, limitKey);
List<Map<String, Object>> list = reviewService.limitReviewList(user_id, page, start_time, end_time, film_type_name, keyword);
List<Map<String, Object>> list = reviewService.limitReviewList(user_id, page, push_date, film_type_name, keyword);
return Rjx.jsonOk().setData(list).setPage(page);
}
......@@ -73,16 +72,15 @@ public class UserReviewController {
@ApiImplicitParam(paramType = "query", dataType = "long", required = false, name = "index", value="分页页码"),
@ApiImplicitParam(paramType = "query", dataType = "long", required = false, name = "limit", value="分页大小"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "limitKey", value="分页排序", allowMultiple=true),
@ApiImplicitParam(paramType = "query", dataType = "date", required = false, name = "start_time", value="开始时间"),
@ApiImplicitParam(paramType = "query", dataType = "date", required = false, name = "end_time", value="结束时间"),
@ApiImplicitParam(paramType = "query", dataType = "date", required = false, name = "push_date", value="推送日期"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "film_type_name", value="影片类型"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "keyword", value="模糊匹配关键词"),
})
public Object getUnviewList(Long index, Long limit, String[] limitKey, Date start_time, Date end_time, String film_type_name, String keyword) {
public Object getUnviewList(Long index, Long limit, String[] limitKey, Date push_date, String film_type_name, String keyword) {
LoginToken loginToken = tokenService.getToken();
Long user_id = (Long)loginToken.getId();
Page page = new Page(index, limit, limitKey);
List<Map<String, Object>> list = reviewService.limitUnviewList(user_id, page, start_time, end_time, film_type_name, keyword);
List<Map<String, Object>> list = reviewService.limitUnviewList(user_id, page, push_date, film_type_name, keyword);
return Rjx.jsonOk().setData(list).setPage(page);
}
......
......@@ -12,9 +12,9 @@ import com.egolm.film.bean.Fc_film_review;
public interface UserReviewService {
List<Map<String, Object>> limitReviewList(Long user_id, Page page, Date start_time, Date end_time, String film_type_name, String keyword);
List<Map<String, Object>> limitReviewList(Long user_id, Page page, Date push_date, String film_type_name, String keyword);
List<Map<String, Object>> limitUnviewList(Long user_id, Page page, Date start_time, Date end_time, String film_type_name, String keyword);
List<Map<String, Object>> limitUnviewList(Long user_id, Page page, Date push_date, String film_type_name, String keyword);
Long queryMemberFilmIdByFilmId(Long film_id);
......
......@@ -31,21 +31,19 @@ public class UserReviewServiceImpl implements UserReviewService {
public List<Map<String, Object>> limitReviewList(
Long user_id,
Page page,
Date start_time,
Date end_time,
Date push_date,
String film_type_name,
String keyword) {
List<Object> args = new ArrayList<Object>();
List<String> strs = new ArrayList<String>();
args.add(user_id);
if(start_time != null) {
if(push_date != null) {
strs.add("allot.push_time >= ?");
args.add(start_time);
}
if(end_time != null) {
strs.add("allot.push_time < ?");
args.add(DateUtil.day(end_time, 1));
args.add(DateUtil.start(push_date));
args.add(DateUtil.end(DateUtil.start(push_date)));
}
if(film_type_name != null && film_type_name.trim().length() > 0) {
strs.add("film.film_type_name = ?");
......@@ -81,21 +79,18 @@ public class UserReviewServiceImpl implements UserReviewService {
public List<Map<String, Object>> limitUnviewList(
Long user_id,
Page page,
Date start_time,
Date end_time,
Date push_date,
String film_type_name,
String keyword) {
List<Object> args = new ArrayList<Object>();
List<String> strs = new ArrayList<String>();
args.add(user_id);
if(start_time != null) {
if(push_date != null) {
strs.add("allot.push_time >= ?");
args.add(start_time);
}
if(end_time != null) {
strs.add("allot.push_time < ?");
args.add(DateUtil.day(end_time, 1));
args.add(DateUtil.start(push_date));
args.add(DateUtil.end(DateUtil.start(push_date)));
}
if(film_type_name != null && film_type_name.trim().length() > 0) {
strs.add("film.film_type_name = ?");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment