Commit 3a5eb65b authored by Quxl's avatar Quxl

x

parent 9706d9f1
...@@ -3,6 +3,8 @@ package com.egolm.film.api.service; ...@@ -3,6 +3,8 @@ package com.egolm.film.api.service;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.egolm.common.jdbc.Page;
public interface FilmGroupService { public interface FilmGroupService {
List<Map<String, Object>> queryFilmGroupList(); List<Map<String, Object>> queryFilmGroupList();
...@@ -13,4 +15,6 @@ public interface FilmGroupService { ...@@ -13,4 +15,6 @@ 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);
} }
...@@ -7,7 +7,9 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -7,7 +7,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
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.film.api.service.FilmGroupService; import com.egolm.film.api.service.FilmGroupService;
@Service @Service
...@@ -37,5 +39,15 @@ public class FilmGroupServiceImpl implements FilmGroupService { ...@@ -37,5 +39,15 @@ public class FilmGroupServiceImpl implements FilmGroupService {
jdbcTemplate.executeUpdate("delete from fc_film_group where id = ?", id); jdbcTemplate.executeUpdate("delete from fc_film_group where id = ?", id);
jdbcTemplate.executeUpdate("update fc_member_film set group_id = ? where group_id = ?", null, id); 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; ...@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.FilmGroupService; import com.egolm.film.api.service.FilmGroupService;
import com.egolm.film.bean.Fc_film_group; import com.egolm.film.bean.Fc_film_group;
...@@ -28,6 +29,18 @@ public class FilmGroupController { ...@@ -28,6 +29,18 @@ public class FilmGroupController {
@Autowired @Autowired
JdbcTemplate jdbcTemplate; 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 @ResponseBody
@PostMapping("saveOrUpdate") @PostMapping("saveOrUpdate")
@ApiOperation("保存或更新分类") @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