Commit 943d6a63 authored by Quxl's avatar Quxl

x

parent 6fbdd0bb
...@@ -15,6 +15,10 @@ public interface FilmGroupService { ...@@ -15,6 +15,10 @@ public interface FilmGroupService {
void removeFilmGroupById(Integer[] id); void removeFilmGroupById(Integer[] id);
List<Map<String, Object>> queryFilmList(Integer enroll_type_id, String film_country, Page page); List<Map<String, Object>> queryNoGroupFilmList(Integer enroll_type_id, String film_country, Page page);
List<Map<String, Object>> queryGroupFilmList(Integer[] group_id, String keyword, Integer enroll_type_id, Integer film_type_name,
Integer film_type_name_short, Integer play_shanghai, Integer is_important, Integer review_state, Integer review_round,
String film_country, Page page);
} }
...@@ -11,6 +11,7 @@ import com.egolm.common.StringUtil; ...@@ -11,6 +11,7 @@ import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.FilmGroupService; import com.egolm.film.api.service.FilmGroupService;
import com.egolm.film.util.SqlWhere;
@Service @Service
public class FilmGroupServiceImpl implements FilmGroupService { public class FilmGroupServiceImpl implements FilmGroupService {
...@@ -49,7 +50,7 @@ public class FilmGroupServiceImpl implements FilmGroupService { ...@@ -49,7 +50,7 @@ public class FilmGroupServiceImpl implements FilmGroupService {
} }
@Override @Override
public List<Map<String, Object>> queryFilmList(Integer enroll_type_id, String film_country, Page page) { public List<Map<String, Object>> queryNoGroupFilmList(Integer enroll_type_id, String film_country, Page page) {
String table = "fc_member_film"; String table = "fc_member_film";
if(enroll_type_id != null) { if(enroll_type_id != null) {
table = "(select mf.* from fc_member_film mf, fc_member_film_enroll mfe where mf.id = mfe.film_id and mfe.enroll_type_id = " + enroll_type_id + ")"; table = "(select mf.* from fc_member_film mf, fc_member_film_enroll mfe where mf.id = mfe.film_id and mfe.enroll_type_id = " + enroll_type_id + ")";
...@@ -59,8 +60,40 @@ public class FilmGroupServiceImpl implements FilmGroupService { ...@@ -59,8 +60,40 @@ public class FilmGroupServiceImpl implements FilmGroupService {
+ "t.*, " + "t.*, "
+ "(select group_concat(t.playactor_name) from fc_member_film_playactor fp where fp.film_id = t.id and fp.playactor_type = 'director') director_name " + "(select group_concat(t.playactor_name) from fc_member_film_playactor fp where fp.film_id = t.id and fp.playactor_type = 'director') director_name "
+ "from " + "from "
+ "" + table + " t " + (StringUtil.isNotBlank(film_country) ? ("t.film_country = '" + film_country + "'") : ""); + "" + table + " t where t.film_group_id is null " + (StringUtil.isNotBlank(film_country) ? (" and t.film_country = '" + film_country + "'") : "");
return jdbcTemplate.limit(sql, page); return jdbcTemplate.limit(sql, page);
} }
@Override
public List<Map<String, Object>> queryGroupFilmList(Integer[] group_id, String keyword, Integer enroll_type_id,
Integer film_type_name, Integer film_type_name_short, Integer play_shanghai, Integer is_important,
Integer review_state, Integer review_round, String film_country, Page page) {
SqlWhere wehre = new SqlWhere()
.in("film_group_id", group_id)
.eq("film_type_name", film_type_name)
.eq("film_type_name_short", film_type_name_short).eq("play_shanghai", play_shanghai)
.eq("is_important", is_important)
.eq("film_country", film_country)
.eq("review_state", review_state)
.eq("review_round", review_round)
.lk(new String[] {"cn_name", "en_name", "director_name"}, keyword);
;
String table = "fc_member_film";
if(enroll_type_id != null) {
table = "(select mf.* from fc_member_film mf, fc_member_film_enroll mfe where mf.id = mfe.film_id and mfe.enroll_type_id = " + enroll_type_id + ")";
}
String sql = ""
+ "select "
+ "t.*, "
+ "r.review_state, "
+ "r.review_round, "
+ "(select group_concat(t.playactor_name) from fc_member_film_playactor fp where fp.film_id = t.id and fp.playactor_type = 'director') director_name "
+ "from "
+ "" + table + " t left join fc_review r on r.film_id = t.id";
sql = "select * from (" + sql + ") " + StringUtil.join(" and ", " where ", "", "", wehre.getStringList());
return jdbcTemplate.limit(sql, page, wehre.getObjectArray());
}
} }
...@@ -17,6 +17,8 @@ import com.egolm.film.api.service.FilmGroupService; ...@@ -17,6 +17,8 @@ import com.egolm.film.api.service.FilmGroupService;
import com.egolm.film.bean.Fc_film_group; import com.egolm.film.bean.Fc_film_group;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@Api @Api
...@@ -33,12 +35,36 @@ public class FilmGroupController { ...@@ -33,12 +35,36 @@ public class FilmGroupController {
@ResponseBody @ResponseBody
@PostMapping("getFilmList") @PostMapping("getFilmList")
@ApiOperation("查询未分类影片列表") @ApiOperation("查询未分类影片列表")
public Object getFilmList(Integer enroll_type_id, String film_country, String[] orderBy, Long index, Long limit) { public Object queryNoGroupFilmList(Integer enroll_type_id, String film_country, String[] orderBy, 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);
page.setLimitKey(orderBy); page.setLimitKey(orderBy);
List<Map<String, Object>> list = filmGroupService.queryFilmList(enroll_type_id, film_country, page); List<Map<String, Object>> list = filmGroupService.queryNoGroupFilmList(enroll_type_id, film_country, page);
return Rjx.jsonOk().setData(list).setPage(page);
}
@ResponseBody
@PostMapping("getGroupFilmList")
@ApiOperation("查询未分类影片列表")
@ApiImplicitParams({
@ApiImplicitParam(name="group_id", value="所属组ID", allowMultiple=true),
@ApiImplicitParam(name="keyword", value="搜索关键字"),
@ApiImplicitParam(name="enroll_type_id", value="影片性质"),
@ApiImplicitParam(name="film_type_name", value="影片类型"),
@ApiImplicitParam(name="film_type_name_short", value="影片扩展类型"),
@ApiImplicitParam(name="play_shanghai", value="首映情况"),
@ApiImplicitParam(name="is_important", value="重点影片"),
@ApiImplicitParam(name="review_state", value="审片结论"),
@ApiImplicitParam(name="review_round", value="审片轮数"),
@ApiImplicitParam(name="film_country", value="国家地区"),
})
public Object getGroupFilmList(Integer[] group_id, String keyword, Integer enroll_type_id, Integer film_type_name, Integer film_type_name_short, Integer play_shanghai, Integer is_important, Integer review_state, Integer review_round, String film_country, String[] orderBy, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
page.setLimitKey(orderBy);
List<Map<String, Object>> list = filmGroupService.queryGroupFilmList(group_id, keyword, enroll_type_id, film_type_name, film_type_name_short, play_shanghai, is_important, review_state, review_round, film_country, 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