Stringsql="select mf.id, r.review_round, mf.origion_name, mf.en_name, mf.cn_name, mf.film_type_name, mf.film_country, r.review_state, (select GROUP_CONCAT(mfd.playactor_name) from fc_member_film_playactor mfd where mfd.film_id = mf.id and mfd.playactor_type = 'director') director_name from fc_member_film mf, fc_review r where r.film_id = mf.id"+StringUtil.join(" and "," and ","","",w1.getStringList());
Stringsql="select mf.id, r.review_round, r.review_id, mf.origion_name, mf.en_name, mf.cn_name, mf.film_type_name, mf.film_country, r.review_state, (select GROUP_CONCAT(mfd.playactor_name) from fc_member_film_playactor mfd where mfd.film_id = mf.id and mfd.playactor_type = 'director') director_name from fc_member_film mf, fc_review r where r.film_id = mf.id"+StringUtil.join(" and "," and ","","",w1.getStringList());
if(enroll_type_id!=null){
sql="select t.* from ("+sql+") t, fc_member_film_enroll mfe where t.id = mfe.film_id and mfe.enroll_type_id = "+enroll_type_id;
}
...
...
@@ -495,20 +494,13 @@ public class FilmServiceImpl implements FilmService {
Fc_reviewreview=jdbcTemplate.queryForBean("select * from fc_review where film_id = ? and enroll_type_id = ? and review_round = ?",Fc_review.class,member_film_id,enroll_type_id,review_round);
review.setReview_state(1);
jdbcTemplate.update(review);
jdbcTemplate.executeUpdate("delete from fc_review_record where review_id = ?",review.getId());
Stringsql="insert into fc_review_record(review_id, user_id, view_state, review_round, review_state) select ?, ?, ?, ?, ? from dual where not exists (select * form fc_review_record where review_id = ? and user_id = ? and review_round = ?)";