Commit e5a9853b authored by Quxl's avatar Quxl

x

parent 077ef080
......@@ -11,4 +11,5 @@ public interface FilmReportService {
Map<String, Object> applyTypeReport();
List<Map<String, Object>> directorReport(String playactor_name, Page page);
Map<String, Object> directorDetail(String playactor_name);
List<Map<String, Object>> queryUserViewReport(Page page);
}
......@@ -8,6 +8,7 @@ import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.SynthesizedAnnotation;
import org.springframework.stereotype.Service;
import com.egolm.common.DateUtil;
......@@ -172,4 +173,32 @@ public class FilmReportServiceImpl implements FilmReportService {
return res;
}
@Override
public List<Map<String, Object>> queryUserViewReport(Page page) {
String sql = ""
+ "select "
+ "u.uid, "
+ "u.username, "
+ "u.realname, "
+ "count(rr.id) count_all, "
+ "count(case when rr.view_time is not null then rr.id end) count_view, "
+ "count(case when rr.view_time is null then rr.id end) count_not_view, "
+ "count(case when rr.view_time is null and rr.create_time < '" + DateUtil.format(DateUtil.day(new Date(), -2)) + "' then rr.id end) count_timeout "
+ "from "
+ "fc_user u, "
+ "fc_review_record rr "
+ "where "
+ "rr.user_id = u.uid "
+ "group by "
+ "u.uid, "
+ "u.username, "
+ "u.realname ";
System.out.println(sql);
return jdbcTemplate.limit(sql, page);
}
public static void main(String[] args) {
new FilmReportServiceImpl().queryUserViewReport(null);
}
}
......@@ -84,4 +84,15 @@ public class AdminReportController {
return Rjx.jsonOk().setData(filmReportService.directorDetail(playactor_name));
}
@ResponseBody
@PostMapping("user_view_report")
@ApiOperation("评委观看统计")
public Object user_view_report(Long index, Long limit, String[] limitKey) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit, limitKey);
List<Map<String, Object>> list = filmReportService.queryUserViewReport(page);
return Rjx.jsonOk().setData(list);
}
}
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