Commit b67eb21e authored by Quxl's avatar Quxl

x

parent 6815c73a
...@@ -42,9 +42,7 @@ public interface ReviewService { ...@@ -42,9 +42,7 @@ public interface ReviewService {
Integer opt_state, Integer opt_state,
Page page); Page page);
List<Map<String, Object>> queryNewAsianRound3List(String keyword, Integer review_state, String ext_type, Page page); List<Map<String, Object>> queryNewAsianRoundList(String keyword, Integer review_state, Integer review_round, String ext_type, Page page);
List<Map<String, Object>> queryNewAsianRound2List(String keyword, Integer review_state, String ext_type, Page page);
/** /**
* 查询评委审片列表 * 查询评委审片列表
......
...@@ -119,56 +119,58 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -119,56 +119,58 @@ public class ReviewServiceImpl implements ReviewService {
} }
@Override @Override
public List<Map<String, Object>> queryNewAsianRound2List(String keyword, Integer review_state, String ext_type, Page page) { public List<Map<String, Object>> queryNewAsianRoundList(String keyword, Integer review_state, Integer review_round, String ext_type, Page page) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Map<String, Object>> queryNewAsianRound3List(String keyword, Integer review_state, String ext_type, Page page) {
XRException.assertNotBlank("获奖类型不能未空", ext_type); XRException.assertNotBlank("获奖类型不能未空", ext_type);
String sql = "" XRException.assertNotBlank("选片轮数不能为空", review_round);
+ "select " if(review_round.intValue() == 3) {
+ "rh.film_id, " String sql = ""
+ "rh.review_id, " + "select "
+ "rh.enroll_type_id, " + "rh.film_id, "
+ "rh.review_round, " + "rh.review_id, "
+ "rh.review_state, " + "rh.enroll_type_id, "
+ "rh.opt_state, " + "rh.review_round, "
+ "mf.cn_name, " + "rh.review_state, "
+ "mf.en_name, " + "rh.opt_state, "
+ "mf.film_no, " + "mf.cn_name, "
+ "rre.ext_type, " + "mf.en_name, "
+ "rre.ext_name, " + "mf.film_no, "
+ "avg(rre.ext_score) ext_score_avg " + "rre.ext_type, "
+ "from " + "rre.ext_name, "
+ "fc_review_record_ext rre, " + "avg(rre.ext_score) ext_score_avg "
+ "fc_review_record rr, " + "from "
+ "fc_review_history rh left join fc_member_film mf on mf.id = rh.film_id " + "fc_review_record_ext rre, "
+ "where " + "fc_review_record rr, "
+ "rre.ext_type = '" + ext_type + "' " + "fc_review_history rh left join fc_member_film mf on mf.id = rh.film_id "
+ "and rh.review_round = 3 " + "where "
+ "and rre.record_id = rr.id " + "rre.ext_type = '" + ext_type + "' "
+ "and rr.review_id = rh.review_id " + "and rh.review_round = 3 "
+ "and rh.enroll_type_id = 2 " + "and rre.record_id = rr.id "
+ "and rh.opt_state = 2 " + "and rr.review_id = rh.review_id "
+ "group by " + "and rh.enroll_type_id = 2 "
+ "rh.film_id, " + "and rh.opt_state = 2 "
+ "rh.review_id, " + "group by "
+ "rh.enroll_type_id, " + "rh.film_id, "
+ "rh.review_round, " + "rh.review_id, "
+ "rh.review_state, " + "rh.enroll_type_id, "
+ "rh.opt_state, " + "rh.review_round, "
+ "mf.cn_name, " + "rh.review_state, "
+ "mf.en_name, " + "rh.opt_state, "
+ "mf.film_no, " + "mf.cn_name, "
+ "rre.ext_type, " + "mf.en_name, "
+ "rre.ext_name" + "mf.film_no, "
; + "rre.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); + "rre.ext_name"
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"; 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);
return jdbcTemplate.limit(sql, page, where.getObjectList()); 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());
} else if(review_round.intValue() == 2) {
throw new XRException("亚新二选榜单没有没有准备好");
} else {
throw new XRException("只能查询亚新2,3选榜单");
}
} }
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -93,38 +93,21 @@ public class AdminReviewController { ...@@ -93,38 +93,21 @@ public class AdminReviewController {
} }
@ResponseBody @ResponseBody
@PostMapping("getNewAsianRound2List") @PostMapping("getNewAsianRoundList")
@ApiOperation("查询亚新2选榜单") @ApiOperation("查询亚新榜单")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", name="keyword", value="搜索关键字"), @ApiImplicitParam(paramType="query", dataType="string", name="keyword", value="搜索关键字"),
@ApiImplicitParam(paramType="query", dataType="int", name="review_state", value="评委意见(3参赛 4参赛备选 5参展)"), @ApiImplicitParam(paramType="query", dataType="int", name="review_state", value="评委意见(3参赛 4参赛备选 5参展)"),
@ApiImplicitParam(paramType="query", dataType="int", name="ext_type", value="获奖类型(前端根据审片时保存到数据库的对应字段进行检索)"), @ApiImplicitParam(paramType="query", dataType="int", name="ext_type", value="获奖类型(前端根据审片时保存到数据库的对应字段进行检索)"),
@ApiImplicitParam(paramType="query", dataType="int", name="review_round", value="第2或3选(2,3)"),
@ApiImplicitParam(paramType="query", dataType="long", name="index", value="分页编号"), @ApiImplicitParam(paramType="query", dataType="long", name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", name="limit", value="分页大小"), @ApiImplicitParam(paramType="query", dataType="long", name="limit", value="分页大小"),
}) })
public Object getNewAsianRound2List(String keyword, Integer review_state, String ext_type, Long index, Long limit) { public Object getNewAsianRound3List(String keyword, Integer review_state, Integer review_round, String ext_type, Long index, Long limit) {
index = index == null ? 1 : index; index = index == null ? 1 : index;
limit = limit == null ? 20 : limit; limit = limit == null ? 20 : limit;
Page page = new Page(index, limit); Page page = new Page(index, limit);
List<Map<String, Object>> list = reviewService.queryNewAsianRound2List(keyword, review_state, ext_type, page); List<Map<String, Object>> list = reviewService.queryNewAsianRoundList(keyword, review_state, review_round, ext_type, page);
return Rjx.jsonOk().setData(list).setPage(page);
}
@ResponseBody
@PostMapping("getNewAsianRound3List")
@ApiOperation("查询亚新3选榜单")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", name="keyword", value="搜索关键字"),
@ApiImplicitParam(paramType="query", dataType="int", name="review_state", value="评委意见(3参赛 4参赛备选 5参展)"),
@ApiImplicitParam(paramType="query", dataType="int", name="ext_type", value="获奖类型(前端根据审片时保存到数据库的对应字段进行检索)"),
@ApiImplicitParam(paramType="query", dataType="long", name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", name="limit", value="分页大小"),
})
public Object getNewAsianRound3List(String keyword, Integer review_state, String ext_type, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
List<Map<String, Object>> list = reviewService.queryNewAsianRound3List(keyword, review_state, ext_type, page);
return Rjx.jsonOk().setData(list).setPage(page); return Rjx.jsonOk().setData(list).setPage(page);
} }
......
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