Commit 055757c6 authored by Quxl's avatar Quxl

x

parent 97b03e95
...@@ -14,12 +14,10 @@ public interface ReviewService { ...@@ -14,12 +14,10 @@ public interface ReviewService {
Object queryDoubtfulList(); Object queryDoubtfulList();
List<Map<String, Object>> queryReviewList(boolean is_review, Integer user_id, Date start_date, Date end_date, Integer film_type_id, Integer enroll_type_id, String keyword, Page page); List<Map<String, Object>> queryReviewList(String keyword, Integer group_id, Integer enroll_type_id, Integer film_type_name, Integer film_type_name_short, String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer state, Page page);
List<Map<String, Object>> queryReviewList(String keyword, Integer group_id, Integer enroll_type_id, Integer film_type_name, Integer film_type_name_short,
String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer state, Page page);
List<Map<String, Object>> queryReviewListByUserId(boolean is_review, Integer user_id, String keyword, Date start_date, Date end_date, Integer film_type_id, Integer enroll_type_id, Page page);
Fc_review queryReview(Integer film_id, Integer enroll_type_id); Fc_review queryReview(Integer film_id, Integer enroll_type_id);
void saveDoubtful(Fc_review_doubtful doubtful); void saveDoubtful(Fc_review_doubtful doubtful);
......
...@@ -27,55 +27,6 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -27,55 +27,6 @@ public class ReviewServiceImpl implements ReviewService {
@Autowired @Autowired
JdbcTemplate jdbcTemplate; JdbcTemplate jdbcTemplate;
@Override
public List<Map<String, Object>> queryReviewList(boolean is_review, Integer user_id, Date start_date, Date end_date, Integer film_type_id, Integer enroll_type_id, String keyword, Page page) {
SqlWhere where = new SqlWhere()
.where(is_review ? "r.review_state is not null" : "r.review_state is null", new Object[]{})
.where("r.review_round in (select ugf.fun_id from fc_user_group_fun ugf, fc_user u where ugf.group_id = u.group_id and u.uid = ?)", new Object[]{user_id})
.ge("r.push_time", start_date)
.lt("r.push_time", end_date == null ? null : DateUtil.end(end_date))
.eq("r.enroll_type_id", enroll_type_id)
.lk(new String[]{"mf.en_name", "mf.cn_name"}, keyword)
;
String sql = ""
+ "select "
+ "mf.id, "
+ "mf.film_no, "
+ "mf.origion_name, "
+ "mf.en_name, "
+ "mf.cn_name, "
+ "mf.film_country, "
+ "mf.film_type_name, "
+ "mf.film_type_name_short, "
+ "mf.upload_state, "
+ "r.id review_id, "
+ "r.enroll_type_id, "
+ "r.review_round, "
+ "r.allot_state, "
+ "r.review_state, "
+ "r.push_time, "
+ "rr.view_state, "
+ "rr.review_state user_review_state, "
+ "rr.review_score, "
+ "rr.review_text, "
+ "rr.review_text_1, "
+ "rr.review_text_2, "
+ "rr.review_text_3, "
+ "rr.review_text_4 "
+ "from "
+ "fc_member_film mf, fc_review r, fc_review_record rr "
+ "where "
+ "mf.id = r.film_id "
+ "and r.id = rr.review_id "
+ "and r.review_round = rr.review_round "
+ "and rr.user_id = " + user_id
+ StringUtil.join(" and ", " and ", "", "", where.getStringList());
return jdbcTemplate.limit(sql, page, where.getObjectList());
}
/**
* 检索审片列表
*/
@Override @Override
public List<Map<String, Object>> queryReviewList(String keyword, Integer group_id, Integer enroll_type_id, Integer film_type_name, public List<Map<String, Object>> queryReviewList(String keyword, Integer group_id, Integer enroll_type_id, Integer film_type_name,
Integer film_type_name_short, String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer state, Integer film_type_name_short, String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer state,
...@@ -136,7 +87,60 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -136,7 +87,60 @@ public class ReviewServiceImpl implements ReviewService {
return jdbcTemplate.limit(sql, page, w1.getObjectList()); return jdbcTemplate.limit(sql, page, w1.getObjectList());
} }
@Override
public List<Map<String, Object>> queryReviewListByUserId(
boolean is_review,
Integer user_id,
String keyword,
Date start_date,
Date end_date,
Integer film_type_id,
Integer enroll_type_id,
Page page) {
SqlWhere where = new SqlWhere()
.where(is_review ? "r.review_state is not null" : "r.review_state is null", new Object[]{})
.where("r.review_round in (select ugf.fun_id from fc_user_group_fun ugf, fc_user u where ugf.group_id = u.group_id and u.uid = ?)", new Object[]{user_id})
.ge("r.push_time", start_date)
.lt("r.push_time", end_date == null ? null : DateUtil.end(end_date))
.eq("r.enroll_type_id", enroll_type_id)
.lk(new String[]{"mf.en_name", "mf.cn_name"}, keyword)
;
String sql = ""
+ "select "
+ "mf.id, "
+ "mf.film_no, "
+ "mf.origion_name, "
+ "mf.en_name, "
+ "mf.cn_name, "
+ "mf.film_country, "
+ "mf.film_type_name, "
+ "mf.film_type_name_short, "
+ "mf.upload_state, "
+ "r.id review_id, "
+ "r.enroll_type_id, "
+ "r.review_round, "
+ "r.allot_state, "
+ "r.review_state, "
+ "r.push_time, "
+ "rr.view_state, "
+ "rr.review_state user_review_state, "
+ "rr.review_score, "
+ "rr.review_text, "
+ "rr.review_text_1, "
+ "rr.review_text_2, "
+ "rr.review_text_3, "
+ "rr.review_text_4 "
+ "from "
+ "fc_member_film mf, fc_review r, fc_review_record rr "
+ "where "
+ "mf.id = r.film_id "
+ "and r.id = rr.review_id "
+ "and r.review_round = rr.review_round "
+ "and rr.user_id = " + user_id
+ StringUtil.join(" and ", " and ", "", "", where.getStringList());
return jdbcTemplate.limit(sql, page, where.getObjectList());
}
@Override @Override
public Object queryDoubtfulList() { public Object queryDoubtfulList() {
......
...@@ -62,7 +62,7 @@ public class UserReviewController { ...@@ -62,7 +62,7 @@ public class UserReviewController {
Page page = new Page(index, limit); Page page = new Page(index, limit);
LoginToken loginToken = tokenService.getToken(); LoginToken loginToken = tokenService.getToken();
Integer user_id = (Integer)loginToken.getId(); Integer user_id = (Integer)loginToken.getId();
List<Map<String, Object>> list = service.queryReviewList(is_review, user_id, start_date, end_date, film_type_id, enroll_type_id, keyword, page); List<Map<String, Object>> list = service.queryReviewListByUserId(is_review, user_id, keyword, start_date, end_date, film_type_id, enroll_type_id, page);
return Rjx.jsonOk().setData(list).setPage(page); return Rjx.jsonOk().setData(list).setPage(page);
} }
......
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