Commit 5feeea7d authored by Quxl's avatar Quxl

x

parent a38128d2
...@@ -11,6 +11,6 @@ public interface FilmReportService { ...@@ -11,6 +11,6 @@ public interface FilmReportService {
Map<String, Object> applyTypeReport(); Map<String, Object> applyTypeReport();
List<Map<String, Object>> directorReport(String playactor_name, Page page); List<Map<String, Object>> directorReport(String playactor_name, Page page);
Map<String, Object> directorDetail(String playactor_name); Map<String, Object> directorDetail(String playactor_name);
List<Map<String, Object>> queryUserViewReport(Page page); List<Map<String, Object>> queryUserViewReport(String keyword, Page page);
List<Map<String, Object>> queryUserReiewReport(Integer user_id, Page page); List<Map<String, Object>> queryUserReiewReport(Integer user_id, Page page);
} }
...@@ -15,6 +15,7 @@ import com.egolm.common.StringUtil; ...@@ -15,6 +15,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.FilmReportService; import com.egolm.film.api.service.FilmReportService;
import com.egolm.film.util.SqlWhere;
@Service @Service
public class FilmReportServiceImpl implements FilmReportService { public class FilmReportServiceImpl implements FilmReportService {
...@@ -178,7 +179,9 @@ public class FilmReportServiceImpl implements FilmReportService { ...@@ -178,7 +179,9 @@ public class FilmReportServiceImpl implements FilmReportService {
} }
@Override @Override
public List<Map<String, Object>> queryUserViewReport(Page page) { public List<Map<String, Object>> queryUserViewReport(String keyword, Page page) {
SqlWhere where = new SqlWhere();
where.lk(new String[] {"u.username", "u.realname"}, keyword);
String sql = "" String sql = ""
+ "select " + "select "
+ "u.uid, " + "u.uid, "
...@@ -192,13 +195,13 @@ public class FilmReportServiceImpl implements FilmReportService { ...@@ -192,13 +195,13 @@ public class FilmReportServiceImpl implements FilmReportService {
+ "fc_user u, " + "fc_user u, "
+ "fc_review_record rr " + "fc_review_record rr "
+ "where " + "where "
+ "rr.user_id = u.uid " + "rr.user_id = u.uid " + StringUtil.join(" and ", " and ", "", "", where.getStringList())
+ "group by " + "group by "
+ "u.uid, " + "u.uid, "
+ "u.username, " + "u.username, "
+ "u.realname "; + "u.realname ";
System.out.println(sql); System.out.println(sql);
return jdbcTemplate.limit(sql, page); return jdbcTemplate.limit(sql, page, where.getObjectArray());
} }
@Override @Override
......
...@@ -87,11 +87,11 @@ public class AdminReportController { ...@@ -87,11 +87,11 @@ public class AdminReportController {
@ResponseBody @ResponseBody
@PostMapping("view_report") @PostMapping("view_report")
@ApiOperation("看片统计") @ApiOperation("看片统计")
public Object user_view_report(Long index, Long limit, String[] limitKey) { public Object user_view_report(String keyword, Long index, Long limit, String[] limitKey) {
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, limitKey); Page page = new Page(index, limit, limitKey);
List<Map<String, Object>> list = filmReportService.queryUserViewReport(page); List<Map<String, Object>> list = filmReportService.queryUserViewReport(keyword, 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