Commit 20fed425 authored by Quxl's avatar Quxl

x

parent 7998ed38
...@@ -112,4 +112,7 @@ public interface ReviewService { ...@@ -112,4 +112,7 @@ public interface ReviewService {
List<Map<String, Object>> queryReviewHistoryList(List<Integer> types, Page page); List<Map<String, Object>> queryReviewHistoryList(List<Integer> types, Page page);
List<Map<String, Object>> queryExhibitionList(String keyword, Integer enroll_type_id, Integer film_type_name,
Integer film_type_name_short, String film_country, Integer from_round, Page page);
} }
\ No newline at end of file
...@@ -727,4 +727,48 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -727,4 +727,48 @@ public class ReviewServiceImpl implements ReviewService {
return jdbcTemplate.limit(sql, page); return jdbcTemplate.limit(sql, page);
} }
@Override
public List<Map<String, Object>> queryExhibitionList(String keyword, Integer enroll_type_id, Integer film_type_name, Integer film_type_name_short, String film_country, Integer from_round, Page page) {
String sql_film = "fc_member_film";
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 + ")";
}
String sql = ""
+ "select "
+ "r.*, "
+ "mf.id film_id_enroll, "
+ "mf.cn_name, "
+ "mf.en_name, "
+ "mf.enroll_type_name, "
+ "mf.film_type_name, "
+ "mf.film_country, "
+ "mf.director, "
+ "mf.film_total_time, "
+ "mf.completion_date, "
+ "mf.play_shanghai, "
+ "rh.review_round state_3_round, "
+ "(select count(fp.id) from fc_member_film_playactor fp where fp.film_id = mf.id and fp.playactor_type = 'director') director_name "
+ "from "
+ "fc_review r "
+ "left join (" + sql_film + ") mf on mf.id = r.film_id "
+ "left join fc_review_history rh on rh.enroll_type_id != 4 and rh.review_state = 3 and rh.review_id = r.id "
+ "";
SqlWhere where = new SqlWhere()
.nn("t.film_id_enroll")
.lk(new String[] {"cn_name", "en_name", "director_name"}, keyword)
.eq("film_type_name", film_type_name)
.eq("film_type_name_short", film_type_name_short)
.eq("film_country", film_country)
;
if(from_round != null) {
if(from_round == 0) {
where.where("t.state_3_round is null");
} else {
where.eq("state_3_round", from_round);
}
}
sql = "select t.* from (" + sql + ") t " + StringUtil.join(" and ", " where ", "", where.getStringList()) + " order by t.film_id desc";
return jdbcTemplate.limit(sql, page, where.getObjectArray());
}
} }
\ No newline at end of file
...@@ -172,15 +172,28 @@ public class AdminReviewController { ...@@ -172,15 +172,28 @@ public class AdminReviewController {
@PostMapping({"getExhibitionList"}) @PostMapping({"getExhibitionList"})
@ApiOperation("查询展映榜单") @ApiOperation("查询展映榜单")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", name="keyword", value="搜索关键字"),
@ApiImplicitParam(paramType="query", dataType="int", name="enroll_type_id", value="搜索关键字"),
@ApiImplicitParam(paramType="query", dataType="int", name="film_type_name", value="搜索关键字"),
@ApiImplicitParam(paramType="query", dataType="int", name="film_type_name_short", value="搜索关键字"),
@ApiImplicitParam(paramType="query", dataType="string", name="film_country", value="搜索关键字"),
@ApiImplicitParam(paramType="query", dataType="int", name="from_round", value="影片来源 0原始申报 2二选参展, 3三选参展 5 选片参展"),
}) })
public Object getExhibitionList( public Object getExhibitionList(
String keyword,
Integer enroll_type_id,
Integer film_type_name,
Integer film_type_name_short,
String film_country,
Integer from_round,
Long index, Long index,
Long limit) { 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);
return Rjx.jsonOk().setPage(page); List<Map<String, Object>> list = reviewService.queryExhibitionList(keyword, enroll_type_id, film_type_name, film_type_name_short, film_country, from_round, page);
return Rjx.jsonOk().setData(list).setPage(page);
} }
@ResponseBody @ResponseBody
......
...@@ -157,10 +157,12 @@ public class AdminUserController { ...@@ -157,10 +157,12 @@ public class AdminUserController {
user.setSalt(salt); user.setSalt(salt);
user.setPassword(encodePassword); user.setPassword(encodePassword);
service.saveUser(user); service.saveUser(user);
} else if(StringUtil.isNotBlank(password)){ } else {
service.updateUserInfo(user); service.updateUserInfo(user);
if(StringUtil.isNotBlank(password)) {
service.changePassword(user.getUid(), password); service.changePassword(user.getUid(), password);
} }
}
return Rjx.jsonOk().setData(user); return Rjx.jsonOk().setData(user);
} }
......
...@@ -15,7 +15,7 @@ public class SqlWhere { ...@@ -15,7 +15,7 @@ public class SqlWhere {
this.objList = new ArrayList<Object>(); this.objList = new ArrayList<Object>();
} }
public SqlWhere where(String where, Object[] obj) { public SqlWhere where(String where, Object... obj) {
if(StringUtil.isNotBlank(where)) { if(StringUtil.isNotBlank(where)) {
this.strList.add(where); this.strList.add(where);
if(obj != null){ if(obj != null){
...@@ -27,6 +27,13 @@ public class SqlWhere { ...@@ -27,6 +27,13 @@ public class SqlWhere {
return this; return this;
} }
public SqlWhere nn(String name) {
if(StringUtil.isNotBlank(name)) {
this.strList.add(name + " is not null");
}
return this;
}
public SqlWhere eq(String name, Object obj) { public SqlWhere eq(String name, Object obj) {
if(StringUtil.isNotBlank(obj)) { if(StringUtil.isNotBlank(obj)) {
this.strList.add(name + " = ?"); this.strList.add(name + " = ?");
......
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