Commit deb41d17 authored by Quxl's avatar Quxl

x

parent b96a4fea
......@@ -62,6 +62,7 @@ public class ReviewServiceImpl implements ReviewService {
.eq("mf.film_type_name", film_type_name)
.eq("mf.film_type_name_short", film_type_name_short)
.eq("mf.film_country", film_country)
.lk("mf.keywords", keyword)
.eq("r.review_round", review_round)
.eq("r.review_state", review_state)
.eq("r.allot_state", allot_state)
......@@ -87,13 +88,13 @@ public class ReviewServiceImpl implements ReviewService {
+ "mf.enroll_type_name, "
+ "mf.enroll_type_name_other, "
+ "mf.upload_state, "
+ "mf.play_shanghai, "
+ "mf.play_shanghai,"
+ "mf.director_name, "
+ "r.id review_id, "
+ "r.review_round, "
+ "r.review_state, "
+ "r.allot_state, "
+ "r.opt_state, "
+ "(select group_concat(fp.playactor_name) from fc_member_film_playactor fp where fp.film_id = mf.id and fp.playactor_type = 'director' group by fp.film_id, fp.playactor_type) director_name, "
+ "count(rr.id) user_count, "
+ "count(case when rr.review_state is not null then rr.id end) user_review_count "
+ "from "
......@@ -122,18 +123,6 @@ public class ReviewServiceImpl implements ReviewService {
+ "r.opt_state "
;
SqlWhere w2 = new SqlWhere();
if(StringUtil.isNotBlank(keyword)) {
String lkstr = "%" + keyword + "%";
if(keyword.matches("\\d+")) {
w2.where("(t.en_name like ? or t.cn_name like ? or t.director_name like ? or t.film_no = ?)", new Object[] {lkstr, lkstr, lkstr, Integer.valueOf(keyword)});
} else {
w2.where("(t.en_name like ? or t.cn_name like ? or t.director_name like ?)", new Object[] {lkstr, lkstr, lkstr});
}
sql = "select t.* from (" + sql + ") t" + StringUtil.join(" and ", " where ", " ", " ", w2.getStringList());
w1.getObjectList().addAll(w2.getObjectList());
}
return jdbcTemplate.limit(sql, page, w1.getObjectArray());
}
......@@ -624,14 +613,15 @@ public class ReviewServiceImpl implements ReviewService {
+ "mf.film_total_time, "
+ "mf.completion_date, "
+ "mf.play_shanghai, "
+ "(select group_concat(fp.playactor_name) from fc_member_film_playactor fp where fp.film_id = mf.id and fp.playactor_type = 'director' group by fp.film_id, fp.playactor_type) director_name "
+ "mf.director_name, "
+ "mf.keywords "
+ "from "
+ "fc_review r "
+ "left join fc_member_film mf on mf.id = r.film_id "
+ (enroll_type_id == null ? "" : (", fc_member_film_enroll mfe where mfe.film_id = r.film_id and mfe.enroll_type_id = " + enroll_type_id))
;
SqlWhere where = new SqlWhere()
.lk(new String[] {"t.cn_name", "t.en_name", "t.director_name"}, keyword)
.lk("t.keywords", keyword)
.eq("t.film_type_name", film_type_name)
.eq("t.film_type_name_short", film_type_name_short)
.eq("t.film_country", film_country)
......
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