Commit 8b46ccb3 authored by Quxl's avatar Quxl

x

parent 886b4476
......@@ -123,50 +123,45 @@ public class ReviewServiceImpl implements ReviewService {
public List<Map<String, Object>> listNewAsianList(String keyword, Integer review_state, String ext_type, Integer review_round, Page page) {
XRException.assertNotBlank("评选轮数不能未空", review_round);
XRException.assertNotBlank("获奖类型不能未空", ext_type);
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);
String sql = ""
+ "select "
+ "r.id, "
+ "r.film_id, "
+ "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, "
+ "r.enroll_type_id, "
+ "r.review_round, "
+ "r.allot_stte, "
+ "r.review_state, "
+ "r.opt_state, "
+ "r.push_time, "
+ "r.review_time, "
+ "rre.ext_type, "
+ "rre.ext_name, "
+ "avg(rre.ext_score) ext_score_avg "
+ "from "
+ "fc_review r, fc_member_film mf, fc_review_record rr, fc_review_record_ext rre "
+ "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 "
+ "rr.review_round = " + review_round + " "
+ "rre.ext_type = '" + ext_type + "' "
+ "and r.film_id = mf.id "
+ "and r.id = rr.review_id "
+ "and rr.id = rre.record_id "
+ "and rr.review_state = 2, "
+ "and rr.review_time is not null "
+ "and rre.id is not null "
+ "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 "
+ "r.id, "
+ "r.film_id, "
+ "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, "
+ "r.enroll_type_id, "
+ "r.review_round, "
+ "r.allot_stte, "
+ "r.review_state, "
+ "r.opt_state, "
+ "r.push_time, "
+ "r.review_time, "
+ "rre.ext_type, "
+ "rre.ext_name ";
+ "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";
return jdbcTemplate.limit(sql, page, where.getObjectList());
......@@ -593,6 +588,7 @@ public class ReviewServiceImpl implements ReviewService {
}
}
}
Integer opt_state = jdbcTemplate.queryForInt("select opt_state from fc_review where id = ?", review.getId());
Fc_review_history history = new Fc_review_history();
history.setReview_id(review.getId());
history.setEnroll_type_id(enroll_type_id);
......@@ -600,6 +596,7 @@ public class ReviewServiceImpl implements ReviewService {
history.setReview_round(review_round);
history.setReview_state(review_state);
history.setCreate_time(new Date());
history.setOpt_state(opt_state);
jdbcTemplate.save(history);
}
......
......@@ -32,6 +32,9 @@ public class Fc_review_history implements java.io.Serializable {
@Column(columnDefinition="int(11) COMMENT '审片结论 1通过 2否决 3参赛 4参赛备选 5参展'")
private Integer review_state;
@Column(columnDefinition="int(11)'")
private Integer opt_state;
@Column(columnDefinition="datetime'")
private Date create_time;
......@@ -84,6 +87,14 @@ public class Fc_review_history implements java.io.Serializable {
return review_state;
}
public void setOpt_state(Integer opt_state) {
this.opt_state = opt_state;
}
public Integer getOpt_state() {
return opt_state;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
......
......@@ -24,10 +24,10 @@ public class Fc_review_record_ext implements java.io.Serializable {
@Column(columnDefinition="double(10,2) COMMENT '奖项评分'")
private Double ext_score;
@Column(columnDefinition="varchar(255) COMMENT '演职员类型'")
@Column(columnDefinition="varchar(255) COMMENT '获奖类型'")
private String ext_type;
@Column(columnDefinition="varchar(255) COMMENT '演职员名称'")
@Column(columnDefinition="varchar(255) COMMENT '获奖主体名称'")
private String ext_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