Commit d645af45 authored by Quxl's avatar Quxl

x

parent b7ba6a96
...@@ -15,7 +15,7 @@ public interface FilmGroupService { ...@@ -15,7 +15,7 @@ public interface FilmGroupService {
void removeFilmGroupById(Integer[] id); void removeFilmGroupById(Integer[] id);
List<Map<String, Object>> queryNoGroupFilmList(Integer enroll_type_id, String film_country, Page page); List<Map<String, Object>> queryNoGroupFilmList(String keyword, 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, 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, Integer film_type_name_short, Integer play_shanghai, Integer is_important, Integer review_state, Integer review_round,
......
...@@ -68,7 +68,11 @@ public class FilmGroupServiceImpl implements FilmGroupService { ...@@ -68,7 +68,11 @@ public class FilmGroupServiceImpl implements FilmGroupService {
} }
@Override @Override
public List<Map<String, Object>> queryNoGroupFilmList(Integer enroll_type_id, String film_country, Page page) { public List<Map<String, Object>> queryNoGroupFilmList(String keyword, Integer enroll_type_id, String film_country, Page page) {
SqlWhere wehre = new SqlWhere()
.eq("t.film_country", film_country)
.lk("t.keywords", keyword);
;
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 + ")";
...@@ -77,15 +81,25 @@ public class FilmGroupServiceImpl implements FilmGroupService { ...@@ -77,15 +81,25 @@ public class FilmGroupServiceImpl implements FilmGroupService {
+ "select " + "select "
+ "t.* " + "t.* "
+ "from " + "from "
+ "" + table + " t, fc_review r where r.film_id = t.id and r.opt_state = 3 and r.review_state != 2 and t.film_group_id is null " + (StringUtil.isNotBlank(film_country) ? (" and t.film_country = '" + film_country + "'") : ""); + "" + table + " t, fc_review r where r.film_id = t.id and r.opt_state = 3 and r.review_state != 2 and t.film_group_id is null " + StringUtil.join(" and ", " ", "", "", wehre.getStringList());
return jdbcTemplate.limit(sql, page); return jdbcTemplate.limit(sql, page, wehre.getObjectArray());
} }
@Override @Override
public List<Map<String, Object>> queryGroupFilmList(Integer[] group_id, String keyword, Integer enroll_type_id, 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 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) { Integer review_state, Integer review_round, String film_country, Page page) {
SqlWhere wehre = new SqlWhere()
.in("t.film_group_id", group_id)
.eq("t.film_type_name", film_type_name)
.eq("t.film_type_name_short", film_type_name_short)
.eq("t.play_shanghai", play_shanghai)
.eq("t.is_important", is_important)
.eq("t.film_country", film_country)
.eq("r.review_state", review_state)
.eq("r.review_round", review_round)
.lk("t.keywords", keyword);
;
String table = "fc_member_film"; String table = "fc_member_film";
if(enroll_type_id != null) { if(enroll_type_id != null) {
...@@ -98,21 +112,7 @@ public class FilmGroupServiceImpl implements FilmGroupService { ...@@ -98,21 +112,7 @@ public class FilmGroupServiceImpl implements FilmGroupService {
+ "r.review_round, " + "r.review_round, "
+ "r.opt_state " + "r.opt_state "
+ "from " + "from "
+ "" + table + " t left join fc_review r on r.film_id = t.id"; + "" + table + " t, fc_review r where r.film_id = t.id and r.opt_state = 3 and r.review_state != 2 and t.film_group_id is not null " + StringUtil.join(" and ", " ", "", "", wehre.getStringList());
SqlWhere wehre = new SqlWhere()
.where("tt.opt_state = 3 and tt.review_state != 1")
.in("tt.film_group_id", group_id)
.eq("tt.film_type_name", film_type_name)
.eq("tt.film_type_name_short", film_type_name_short)
.eq("tt.play_shanghai", play_shanghai)
.eq("tt.is_important", is_important)
.eq("tt.film_country", film_country)
.eq("tt.review_state", review_state)
.eq("tt.review_round", review_round)
.lk("tt.keywords", keyword);
;
sql = "select tt.* from (" + sql + ") tt " + StringUtil.join(" and ", " where ", "", "", wehre.getStringList());
return jdbcTemplate.limit(sql, page, wehre.getObjectArray()); return jdbcTemplate.limit(sql, page, wehre.getObjectArray());
} }
......
...@@ -35,12 +35,12 @@ public class FilmGroupController { ...@@ -35,12 +35,12 @@ public class FilmGroupController {
@ResponseBody @ResponseBody
@PostMapping("getFilmList") @PostMapping("getFilmList")
@ApiOperation("查询未分类影片列表") @ApiOperation("查询未分类影片列表")
public Object queryNoGroupFilmList(Integer enroll_type_id, String film_country, String[] orderBy, Long index, Long limit) { public Object queryNoGroupFilmList(String keyword, 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.queryNoGroupFilmList(enroll_type_id, film_country, page); List<Map<String, Object>> list = filmGroupService.queryNoGroupFilmList(keyword, enroll_type_id, 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