|
@@ -519,13 +519,18 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryTeacherTrainingList" resultType="com.ym.mec.biz.dal.dto.TeacherCloudTrainingDto">
|
|
|
- SELECT o.`name_` organName,ifnull(u.`real_name_`,u.`username_` ) username,GROUP_CONCAT(distinct s.`name_`) subjectName,sum(cr.`play_time_`) trainingDurationSeconds,count(DISTINCT(date(cr.`create_time_`))) trianingDays FROM `sys_music_compare_record` cr
|
|
|
+ select a.*,GROUP_CONCAT(distinct s.`name_`) subjectName from
|
|
|
+ (
|
|
|
+ SELECT o.`name_` organName,ifnull(u.`real_name_`,u.`username_` ) username,sum(cr.`play_time_`) trainingDurationSeconds,
|
|
|
+ count(DISTINCT(date(cr.`create_time_`))) trianingDays ,t.subject_id_,cr.`user_id_`
|
|
|
+ FROM `sys_music_compare_record` cr
|
|
|
LEFT JOIN `teacher` t on t.`id_` = cr.`user_id_` and cr.`client_id_` = 'teacher'
|
|
|
- LEFT JOIN `subject` s on find_in_set(s.`id_`,t.`subject_id_` )
|
|
|
LEFT JOIN `sys_user` u on u.`id_` = cr.`user_id_`
|
|
|
LEFT JOIN `organization` o on o.`id_` = t.`organ_id_`
|
|
|
WHERE cr.`client_id_` = 'teacher' and t.`organ_id_` in (${queryInfo.organIdList}) AND date(cr.`create_time_`) BETWEEN #{queryInfo.startTime} and #{queryInfo.endTime} and t.job_nature_ = 'FULL_TIME'
|
|
|
GROUP BY cr.`user_id_`
|
|
|
+ ) a LEFT JOIN `subject` s on find_in_set(s.`id_`,a.`subject_id_` )
|
|
|
+ group by a.user_id_
|
|
|
</select>
|
|
|
|
|
|
<select id="queryTeacherTrainingCount" resultType="int">
|