Commit 3a5eb65b authored by Quxl's avatar Quxl

x

parent 9706d9f1
......@@ -3,6 +3,8 @@ package com.egolm.film.api.service;
import java.util.List;
import java.util.Map;
import com.egolm.common.jdbc.Page;
public interface FilmGroupService {
List<Map<String, Object>> queryFilmGroupList();
......@@ -13,4 +15,6 @@ public interface FilmGroupService {
void removeFilmGroupById(Integer id);
List<Map<String, Object>> queryFilmList(Integer enroll_type_id, String film_country, Page page);
}
......@@ -7,7 +7,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.FilmGroupService;
@Service
......@@ -38,4 +40,14 @@ public class FilmGroupServiceImpl implements FilmGroupService {
jdbcTemplate.executeUpdate("update fc_member_film set group_id = ? where group_id = ?", null, id);
}
@Override
public List<Map<String, Object>> queryFilmList(Integer enroll_type_id, String film_country, Page page) {//TODO
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.* from " + table + " t" + (StringUtil.isNotBlank(film_country) ? ("t.film_country = '" + film_country + "'") : "");
return jdbcTemplate.limit(sql, page);
}
}
......@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.FilmGroupService;
import com.egolm.film.bean.Fc_film_group;
......@@ -28,6 +29,18 @@ public class FilmGroupController {
@Autowired
JdbcTemplate jdbcTemplate;
@ResponseBody
@PostMapping("getFilmList")
@ApiOperation("查询未分类影片列表")
public Object getFilmList(Integer enroll_type_id, 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.queryFilmList(enroll_type_id, film_country, page);
return Rjx.jsonOk().setData(list);
}
@ResponseBody
@PostMapping("saveOrUpdate")
@ApiOperation("保存或更新分类")
......
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