Commit 604ade3d authored by Quxl's avatar Quxl

x

parent 7cbf0db2
...@@ -414,44 +414,46 @@ public class FilmServiceImpl implements FilmService { ...@@ -414,44 +414,46 @@ public class FilmServiceImpl implements FilmService {
} }
public static void main(String[] args) { public static void main(String[] args) {
String sql0 = "" String sql = ""
+ "select " + "select "
+ "mf.id, " + "mf.id, "
+ "mf.film_no, " + "mf.film_no, "
+ "mf.origion_name, "
+ "mf.en_name, " + "mf.en_name, "
+ "mf.cn_name, " + "mf.cn_name, "
+ "mf.film_type_name, " + "mf.film_type_name, "
+ "mf.film_country, "
+ "mf.film_type_name, "
+ "mf.film_type_name_short, " + "mf.film_type_name_short, "
+ "mf.film_total_time, "
+ "mf.completion_date, "
+ "mf.play_shanghai, "
+ "mf.state, "
+ "mf.apply_state, "
+ "mf.upload_id, "
+ "mf.upload_state, " + "mf.upload_state, "
+ "mf.film_country, " + "r.id review_id, "
+ "mf.enroll_type_name, " + "r.review_round, "
+ "group_concat(fp.playactor_name) director_name " + "r.review_state, "
+ "r.allot_state, "
+ "r.state, "
+ "r.enroll_type_id, "
+ "(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 "
+ "from " + "from "
+ "fc_member_film mf, fc_review r, fc_member_film_playactor fp " + "fc_member_film mf, "
+ "fc_review r left join fc_review_record rr on rr.review_id = r.id and rr.review_round = r.review_round "
+ "where " + "where "
+ "mf.id = r.film_id and mf.id = fp.film_id and fp.playactor_type = 'director'" + "r.film_id = mf.id "
+ "group by " + "group by "
+ "mf.id, " + "mf.id, "
+ "mf.film_no, " + "mf.film_no, "
+ "mf.origion_name, "
+ "mf.en_name, " + "mf.en_name, "
+ "mf.cn_name, " + "mf.cn_name, "
+ "mf.film_type_name, " + "mf.film_type_name, "
+ "mf.film_type_name_short, " + "mf.film_country, "
+ "mf.film_total_time, " + "r.id, "
+ "mf.completion_date, " + "r.review_round, "
+ "mf.play_shanghai, " + "r.review_state, "
+ "mf.state, " + "r.allot_state,"
+ "mf.apply_state, " + "r.enroll_type_id "
+ "mf.upload_id, " ;
+ "mf.upload_state, " System.out.println(sql);
+ "mf.film_country ";
System.out.println(sql0);
} }
@Override @Override
...@@ -545,11 +547,11 @@ public class FilmServiceImpl implements FilmService { ...@@ -545,11 +547,11 @@ public class FilmServiceImpl implements FilmService {
SqlWhere w1 = new SqlWhere() SqlWhere w1 = new SqlWhere()
.where("mf.film_type_name in (select agft.film_type_id from fc_admin_group_filmtype agft where agft.group_id = ?)", new Object[]{group_id}) .where("mf.film_type_name in (select agft.film_type_id from fc_admin_group_filmtype agft where agft.group_id = ?)", new Object[]{group_id})
.eq("mf.upload_state", 1) .eq("mf.upload_state", 1)
.gt("r.review_round", 0)
.lk(new String[]{"mf.en_name", "mf.cn_name"}, keyword) .lk(new String[]{"mf.en_name", "mf.cn_name"}, keyword)
.eq("mf.film_type_name", film_type_name) .eq("mf.film_type_name", film_type_name)
.eq("mf.film_type_name_short", film_type_name_short) .eq("mf.film_type_name_short", film_type_name_short)
.eq("mf.film_country", film_country) .eq("mf.film_country", film_country)
.gt("r.review_round", 0)
.eq("r.review_round", review_round) .eq("r.review_round", review_round)
.eq("r.enroll_type_id", enroll_type_id) .eq("r.enroll_type_id", enroll_type_id)
.eq("r.review_state", review_state) .eq("r.review_state", review_state)
...@@ -566,22 +568,23 @@ public class FilmServiceImpl implements FilmService { ...@@ -566,22 +568,23 @@ public class FilmServiceImpl implements FilmService {
+ "mf.cn_name, " + "mf.cn_name, "
+ "mf.film_type_name, " + "mf.film_type_name, "
+ "mf.film_country, " + "mf.film_country, "
+ "mf.film_type_name, "
+ "mf.film_type_name_short, "
+ "mf.upload_state, "
+ "r.id review_id, " + "r.id review_id, "
+ "r.review_round, " + "r.review_round, "
+ "r.review_state, " + "r.review_state, "
+ "r.allot_state," + "r.allot_state, "
+ "r.state, "
+ "r.enroll_type_id, " + "r.enroll_type_id, "
+ "group_concat(fp.playactor_name) director_name, " + "(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(rr.id) user_count "
+ "from " + "from "
+ "fc_member_film mf, fc_review r, fc_review_record rr, fc_member_film_playactor fp " + "fc_member_film mf, "
+ "fc_review r left join fc_review_record rr on rr.review_id = r.id and rr.review_round = r.review_round "
+ "where " + "where "
+ "mf.id = r.film_id " + "r.film_id = mf.id "
+ "and r.id = rr.review_id " + StringUtil.join(" and ", " and ", " ", " ", w1.getStringList())
+ "and r.review_round = rr.review_round "
+ "and mf.id = fp.film_id "
+ "and fp.playactor_type = 'director' "
+ StringUtil.join(" and ", " and ", "", "", w1.getStringList())
+ "group by " + "group by "
+ "mf.id, " + "mf.id, "
+ "mf.film_no, " + "mf.film_no, "
......
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