Commit 886b4476 authored by Quxl's avatar Quxl

x

parent a1c8fe6c
...@@ -42,7 +42,7 @@ public interface ReviewService { ...@@ -42,7 +42,7 @@ public interface ReviewService {
Integer opt_state, Integer opt_state,
Page page); Page page);
List<Map<String, Object>> listNewAsianList(String keyword, Integer review_state, Integer ext_type, Integer reveiw_round, Page page); List<Map<String, Object>> listNewAsianList(String keyword, Integer review_state, String ext_type, Integer reveiw_round, Page page);
/** /**
* 查询评委审片列表 * 查询评委审片列表
......
...@@ -120,15 +120,10 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -120,15 +120,10 @@ public class ReviewServiceImpl implements ReviewService {
} }
@Override @Override
public List<Map<String, Object>> listNewAsianList(String keyword, Integer review_state, Integer ext_type, Integer review_round, Page page) { 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("评选轮数不能未空", review_round);
XRException.assertNotBlank("获奖类型不能未空", ext_type); XRException.assertNotBlank("获奖类型不能未空", ext_type);
SqlWhere where = new SqlWhere() 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);
.eq("rr.review_round", review_round)
.eq("rr.review_state", review_state)
.eq("rre.ext_type", ext_type)
.lk(new String[] {"mf.cn_name", "mf.en_name", "mf.id", "mf.film_no"}, keyword)
;
String sql = "" String sql = ""
+ "select " + "select "
+ "r.id, " + "r.id, "
...@@ -149,13 +144,14 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -149,13 +144,14 @@ public class ReviewServiceImpl implements ReviewService {
+ "from " + "from "
+ "fc_review r, fc_member_film mf, fc_review_record rr, fc_review_record_ext rre " + "fc_review r, fc_member_film mf, fc_review_record rr, fc_review_record_ext rre "
+ "where " + "where "
+ "r.film_id = mf.id " + "rr.review_round = " + review_round + " "
+ "rre.ext_type = '" + ext_type + "' "
+ "and r.film_id = mf.id "
+ "and r.id = rr.review_id " + "and r.id = rr.review_id "
+ "and rr.id = rre.record_id " + "and rr.id = rre.record_id "
+ "and rr.review_state = 2, " + "and rr.review_state = 2, "
+ "and rr.review_time is not null " + "and rr.review_time is not null "
+ "and rre.id is not null " + "and rre.id is not null "
+ StringUtil.join(" and ", "and ", " ", " ", where.getStringList())
+ "group by " + "group by "
+ "r.id, " + "r.id, "
+ "r.film_id, " + "r.film_id, "
...@@ -171,7 +167,8 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -171,7 +167,8 @@ public class ReviewServiceImpl implements ReviewService {
+ "r.review_time, " + "r.review_time, "
+ "rre.ext_type, " + "rre.ext_type, "
+ "rre.ext_name "; + "rre.ext_name ";
sql = "select @rownum:=@rownum+1 as rownum, t.* from (" + sql + ") t, (select @rownum:=0) row order by t.ext_score_avg "; 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()); return jdbcTemplate.limit(sql, page, where.getObjectList());
} }
......
...@@ -96,10 +96,14 @@ public class AdminReviewController { ...@@ -96,10 +96,14 @@ public class AdminReviewController {
@PostMapping("listNewAsianList") @PostMapping("listNewAsianList")
@ApiOperation("查询亚新榜单") @ApiOperation("查询亚新榜单")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"), @ApiImplicitParam(paramType="query", dataType="string", name="keyword", value="搜索关键字"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", 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="int", name="reveiw_round", value="审片环节 2,3"),
@ApiImplicitParam(paramType="query", dataType="long", name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", name="limit", value="分页大小"),
}) })
public Object listNewAsian(String keyword, Integer review_state, Integer ext_type, Integer reveiw_round, Long index, Long limit) { public Object listNewAsian(String keyword, Integer review_state, String ext_type, Integer reveiw_round, 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);
......
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