Commit a5a5e40d authored by Quxl's avatar Quxl

x

parent 5a8dcec1
...@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.egolm.common.DateUtil; import com.egolm.common.DateUtil;
import com.egolm.common.StringUtil; import com.egolm.common.StringUtil;
import com.egolm.common.Util;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
...@@ -153,10 +154,14 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -153,10 +154,14 @@ public class ReviewServiceImpl implements ReviewService {
.lt("r.push_time", end_date == null ? null : DateUtil.end(end_date)) .lt("r.push_time", end_date == null ? null : DateUtil.end(end_date))
.ge("r.review_time", review_start_date) .ge("r.review_time", review_start_date)
.lt("r.review_time", review_end_date == null ? null : DateUtil.end(review_end_date)) .lt("r.review_time", review_end_date == null ? null : DateUtil.end(review_end_date))
.where("r.review_round in (select ugr.review_round from fc_user_group_round ugr, fc_user u where ugr.group_id = u.group_id and u.uid = ?)", new Object[]{user_id})
.where(is_review ? "rr.review_state is not null" : "rr.review_state is null", new Object[]{})
; ;
if(is_review) {
where.where("rr.review_state is not null and rr.review_time is not null");
} else {
where.where("rr.review_state is null and rr.review_time is null and rr.review_round = r.review_round");
}
String sql_film = "fc_member_film"; String sql_film = "fc_member_film";
if(StringUtil.isNotBlank(enroll_type_id)) { if(StringUtil.isNotBlank(enroll_type_id)) {
sql_film = "(select mf0.* from fc_member_film mf0, fc_member_film_enroll mfe where mf0.id = mfe.film_id and mfe.enroll_type_id = " + enroll_type_id + ")"; sql_film = "(select mf0.* from fc_member_film mf0, fc_member_film_enroll mfe where mf0.id = mfe.film_id and mfe.enroll_type_id = " + enroll_type_id + ")";
...@@ -182,6 +187,7 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -182,6 +187,7 @@ public class ReviewServiceImpl implements ReviewService {
+ "r.opt_state, " + "r.opt_state, "
+ "r.push_time, " + "r.push_time, "
+ "r.review_time, " + "r.review_time, "
+ "rr.id record_id, "
+ "rr.review_state user_review_state, " + "rr.review_state user_review_state, "
+ "rr.review_score, " + "rr.review_score, "
+ "rr.review_text, " + "rr.review_text, "
...@@ -194,10 +200,20 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -194,10 +200,20 @@ public class ReviewServiceImpl implements ReviewService {
+ "where " + "where "
+ "mf.id = r.film_id " + "mf.id = r.film_id "
+ "and r.id = rr.review_id " + "and r.id = rr.review_id "
+ "and r.review_round = rr.review_round "
+ "and rr.user_id = " + user_id + "and rr.user_id = " + user_id
+ StringUtil.join(" and ", " and ", "", "", where.getStringList()); + StringUtil.join(" and ", " and ", "", "", where.getStringList());
return jdbcTemplate.limit(sql, page, where.getObjectArray()); List<Map<String, Object>> list = jdbcTemplate.limit(sql, page, where.getObjectArray());
List<String> ids = new ArrayList<String>();
for(Map<String, Object> map : list) {
ids.add(String.valueOf(map.get("record_id")));
}
String sql2 = "select * from fc_review_record_ext where record_id in (" + StringUtil.join(", ", "", "", "''", ids) + ")";
List<Map<String, Object>> extList = jdbcTemplate.queryForList(sql2);
Map<String, List<Map<String, Object>>> extML = Util.listToML(extList, "record_id");
for(Map<String, Object> map : list) {
map.put("exts", extML.get(String.valueOf(map.get("record_id"))));
}
return list;
} }
@Override @Override
......
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