|
@@ -643,8 +643,8 @@ public class DatadetailController {
|
|
public RT<CourseStatisticsDetailVo> courseStatistics(@Valid StatisticsDetailDto dto) {
|
|
public RT<CourseStatisticsDetailVo> courseStatistics(@Valid StatisticsDetailDto dto) {
|
|
CourseStatisticsDetailVo result = new CourseStatisticsDetailVo();
|
|
CourseStatisticsDetailVo result = new CourseStatisticsDetailVo();
|
|
String sql = "SELECT t1.id, t1.name,t4.name AS dept_name," +
|
|
String sql = "SELECT t1.id, t1.name,t4.name AS dept_name," +
|
|
- " (SELECT GROUP_CONCAT(DISTINCT(course_name)) FROM course_table WHERE teacher_id = t1.id) AS course_names," +
|
|
|
|
- " (SELECT COUNT(*) FROM course_table WHERE teacher_id = t1.id) AS course_count FROM xjr_user t1" +
|
|
|
|
|
|
+ " (SELECT GROUP_CONCAT(DISTINCT(course_name)) FROM course_table WHERE teacher_id like concat('%', t1.id,'%') ) AS course_names," +
|
|
|
|
+ " (SELECT COUNT(*) FROM course_table WHERE teacher_id like concat('%', t1.id,'%')) AS course_count FROM xjr_user t1" +
|
|
" INNER JOIN base_teacher t2 ON t1.id = t2.user_id" +
|
|
" INNER JOIN base_teacher t2 ON t1.id = t2.user_id" +
|
|
" INNER JOIN xjr_user_dept_relation t3 ON t1.id = t3.user_id" +
|
|
" INNER JOIN xjr_user_dept_relation t3 ON t1.id = t3.user_id" +
|
|
" INNER JOIN xjr_department t4 ON t3.dept_id = t4.id" +
|
|
" INNER JOIN xjr_department t4 ON t3.dept_id = t4.id" +
|
|
@@ -659,7 +659,7 @@ public class DatadetailController {
|
|
result.setCourseCountList(courseCountList);
|
|
result.setCourseCountList(courseCountList);
|
|
|
|
|
|
sql = "SELECT count(*) FROM course_table t1" +
|
|
sql = "SELECT count(*) FROM course_table t1" +
|
|
- " INNER JOIN base_teacher t2 ON t1.teacher_id = t2.user_id" +
|
|
|
|
|
|
+ " INNER JOIN base_teacher t2 ON t1.teacher_id like concat('%', t2.user_id,'%')" +
|
|
" INNER JOIN xjr_user_dept_relation t3 ON t2.user_id = t3.user_id" +
|
|
" INNER JOIN xjr_user_dept_relation t3 ON t2.user_id = t3.user_id" +
|
|
" INNER JOIN xjr_department t4 ON t4.id = t3.dept_id" +
|
|
" INNER JOIN xjr_department t4 ON t4.id = t3.dept_id" +
|
|
" WHERE t4.delete_mark = 0 AND t2.delete_mark = 0" +
|
|
" WHERE t4.delete_mark = 0 AND t2.delete_mark = 0" +
|
|
@@ -667,7 +667,7 @@ public class DatadetailController {
|
|
long allCourseCount = SqlRunnerAdapter.db().selectCount(sql);
|
|
long allCourseCount = SqlRunnerAdapter.db().selectCount(sql);
|
|
sql = "SELECT name,(" +
|
|
sql = "SELECT name,(" +
|
|
" SELECT COUNT(*) FROM course_table t1" +
|
|
" SELECT COUNT(*) FROM course_table t1" +
|
|
- " INNER JOIN base_teacher t2 ON t1.teacher_id = t2.user_id" +
|
|
|
|
|
|
+ " INNER JOIN base_teacher t2 ON t1.teacher_id like concat('%', t2.user_id,'%')" +
|
|
" INNER JOIN xjr_user_dept_relation t3 ON t2.user_id = t3.user_id" +
|
|
" INNER JOIN xjr_user_dept_relation t3 ON t2.user_id = t3.user_id" +
|
|
" WHERE t3.dept_id = xjr_department.id" +
|
|
" WHERE t3.dept_id = xjr_department.id" +
|
|
" ) AS course_count FROM xjr_department WHERE is_major = 1";
|
|
" ) AS course_count FROM xjr_department WHERE is_major = 1";
|