Stringsql="select u.uid, u.username, u.realname, u.group_id, ug.group_name from fc_user u left join fc_user_group ug on ug.group_id = u.group_id, fc_user_group_funs ugf where u.group_id = ugf.group_id and ugf.fun_id = 2";
Stringsql="select r.* from fc_review r where r.enroll_type_id = 2 and review_round >= "+review_round;
+"select "
//TODO
+"rh.film_id, "
returnnull;
+"rh.review_id, "
+"rh.enroll_type_id, "
+"rh.review_state, "
+"rh.opt_state, "
+"rr.user_group_id, "
+"mf.cn_name, "
+"mf.en_name, "
+"mf.film_no, "
+"rre.ext_type, "
+"rre.ext_name, "
+"r.review_round, "
+"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 left join fc_review r on r.id = rh.review_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, "
+"rr.user_group_id, "
+"mf.cn_name, "
+"mf.en_name, "
+"mf.film_no, "
+"rre.ext_type, "
+"rre.ext_name"
;
sql="select @rownum:=@rownum+1 as rownum, t.* from ("+sql+") t, (select @rownum:=0) row where t.user_group_id = "+user_group_id+" order by t.ext_score_avg desc";
where.where("(tt.film_no = ? or tt.en_name like ? or tt.cn_name like ? or tt.ext_name like ?)",newObject[]{Integer.valueOf(keyword),lkstr,lkstr,lkstr});
Stringsql="select u.*, ug.group_name from fc_user u left join fc_user_group ug on ug.group_id = u.group_id, fc_user_film uf where u.uid = uf.user_id and uf.review_id = ?";
Stringsql="select u.*, ug.group_name from fc_user u left join fc_user_group ug on ug.group_id = u.group_id, fc_user_film uf where u.uid = uf.user_id and uf.review_id = ?";