Commit 3361c471 authored by Quxl's avatar Quxl

x

parent e9ac9bf0
......@@ -187,55 +187,6 @@ public class ReviewServiceImpl implements ReviewService {
return jdbcTemplate.limit(sql, page, where.getObjectArray());
}
public static void main(String[] args) {
String ext_type = "最佳男主角";
Integer review_round = 2;
Integer review_state =null;
String keyword = null;
String sql = ""
+ "select "
+ "rh.film_id, "
+ "rh.review_id, "
+ "rh.enroll_type_id, "
+ "rh.review_round, "
+ "rh.review_state, "
+ "rh.opt_state, "
+ "mf.cn_name, "
+ "mf.en_name, "
+ "mf.film_no, "
+ "rre.ext_type, "
+ "rre.ext_name, "
+ "avg(rre.ext_score) ext_score_avg "
+ "from "
+ "fc_review_record_ext rre, "
+ "fc_review_record rr, "
+ "fc_review_history rh left join fc_member_film mf on mf.id = rh.film_id "
+ "where "
+ "rre.ext_type = '" + ext_type + "' "
+ "and rh.review_round = " + review_round + " "
+ "and rre.record_id = rr.id "
+ "and rr.review_id = rh.review_id "
+ "and rh.enroll_type_id = 2 "
+ "and rh.opt_state = 2 "
+ "group by "
+ "rh.film_id, "
+ "rh.review_id, "
+ "rh.enroll_type_id, "
+ "rh.review_round, "
+ "rh.review_state, "
+ "rh.opt_state, "
+ "mf.cn_name, "
+ "mf.en_name, "
+ "mf.film_no, "
+ "rre.ext_type, "
+ "rre.ext_name "
;
SqlWhere where = new SqlWhere().eq("t.review_state", review_state).lk(new String[] {"tt.cn_name", "tt.en_name", "tt.film_no", "tt.ext_name"}, keyword);
sql = "select @rownum:=@rownum+1 as rownum, t.* from (" + sql + ") t, (select @rownum:=0) row order by t.ext_score_avg desc";
sql = "select tt.* from (" + sql + ") tt " + StringUtil.join(" where ", " and ", "", "", where.getStringList()) + " order by tt.rownum";
System.out.println(sql);
}
@Override
public List<Map<String, Object>> queryReviewListForUser(
boolean is_review,
......
......@@ -17,12 +17,12 @@ public class Fc_review_history implements java.io.Serializable {
@Column(columnDefinition="int(11)'")
private Integer id;
@Column(columnDefinition="int(11) COMMENT '参审影片ID'")
private Integer film_id;
@Column(columnDefinition="int(11)'")
private Integer review_id;
@Column(columnDefinition="int(11) COMMENT '参审影片ID'")
private Integer film_id;
@Column(columnDefinition="int(11) COMMENT '影片性质'")
private Integer enroll_type_id;
......@@ -47,14 +47,6 @@ public class Fc_review_history implements java.io.Serializable {
return id;
}
public void setFilm_id(Integer film_id) {
this.film_id = film_id;
}
public Integer getFilm_id() {
return film_id;
}
public void setReview_id(Integer review_id) {
this.review_id = review_id;
}
......@@ -63,6 +55,14 @@ public class Fc_review_history implements java.io.Serializable {
return review_id;
}
public void setFilm_id(Integer film_id) {
this.film_id = film_id;
}
public Integer getFilm_id() {
return film_id;
}
public void setEnroll_type_id(Integer enroll_type_id) {
this.enroll_type_id = enroll_type_id;
}
......
......@@ -23,6 +23,9 @@ public class Fc_review_record implements java.io.Serializable {
@Column(columnDefinition="int(11) COMMENT '评委ID'")
private Integer user_id;
@Column(columnDefinition="int(11) COMMENT '评委组ID(冗余,用于统计分组榜单,防止用户换组后无法统计)'")
private Integer user_group_id;
@Column(columnDefinition="bigint(11) COMMENT '观看时长(毫秒)'")
private Long view_time;
......@@ -81,6 +84,14 @@ public class Fc_review_record implements java.io.Serializable {
return user_id;
}
public void setUser_group_id(Integer user_group_id) {
this.user_group_id = user_group_id;
}
public Integer getUser_group_id() {
return user_group_id;
}
public void setView_time(Long view_time) {
this.view_time = view_time;
}
......
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