|
@@ -8,6 +8,7 @@
|
|
|
package cn.com.qmth.examcloud.core.print.service.impl;
|
|
|
|
|
|
import cn.com.qmth.examcloud.core.print.common.jpa.SqlWrapper;
|
|
|
+import cn.com.qmth.examcloud.core.print.enums.ExamType;
|
|
|
import cn.com.qmth.examcloud.core.print.service.StatisticService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.common.ExamCourseInfo;
|
|
|
import cn.com.qmth.examcloud.core.print.service.bean.common.ExamInfo;
|
|
@@ -43,22 +44,9 @@ import java.util.Set;
|
|
|
public class StatisticServiceImpl implements StatisticService {
|
|
|
private static final Logger log = LoggerFactory.getLogger(StatisticServiceImpl.class);
|
|
|
@Autowired
|
|
|
- private JdbcTemplate jdbcTemplate;
|
|
|
- @Autowired
|
|
|
private ExamCloudService examCloudService;
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<ExamInfo> findExams(String examType) {
|
|
|
- //暂时直接查库,待“考务”接口提供后改为通过接口获取数据
|
|
|
- SqlWrapper sql = new SqlWrapper()
|
|
|
- .select("em.id examId,em.name examName,em.root_org_id orgId,org.name orgName").from("ec_e_exam em")
|
|
|
- .innerJoin("ec_b_org org").on("org.id", "em.root_org_id");
|
|
|
- if (StringUtils.isNotBlank(examType)) {
|
|
|
- //sql.where().eq("em.exam_type", examType); todo 仅测试,临时注释
|
|
|
- }
|
|
|
- sql.orderBy("em.id", false);
|
|
|
- return jdbcTemplate.query(sql.build(), new BeanPropertyRowMapper(ExamInfo.class));
|
|
|
- }
|
|
|
+ @Autowired
|
|
|
+ private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
@Override
|
|
|
public List<ExamCourseInfo> findExamCourses(Long orgId, Long examId) {
|
|
@@ -221,4 +209,14 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
return properties;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<ExamInfo> findTraditionExams() {
|
|
|
+ SqlWrapper sql = new SqlWrapper()
|
|
|
+ .select("em.id examId,em.name examName,em.root_org_id orgId,org.name orgName").from("ec_e_exam em")
|
|
|
+ .innerJoin("ec_b_org org").on("org.id", "em.root_org_id")
|
|
|
+ .where().eq("em.exam_type", ExamType.TRADITION.name())
|
|
|
+ .orderBy("em.id", false);
|
|
|
+ return jdbcTemplate.query(sql.build(), new BeanPropertyRowMapper(ExamInfo.class));
|
|
|
+ }
|
|
|
+
|
|
|
}
|