|
@@ -240,11 +240,15 @@
|
|
|
SELECT COUNT(DISTINCT s.user_id_)
|
|
|
FROM teacher t
|
|
|
LEFT JOIN student s ON t.id_ = s.teacher_id_
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = s.user_id_
|
|
|
LEFT JOIN sys_music_compare_record mcr ON mcr.user_id_ = s.user_id_
|
|
|
WHERE s.teacher_id_ = #{teacherId}
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
AND (mcr.create_time_ BETWEEN #{startTime} AND #{endTime} OR mcr.id_ IS NULL)
|
|
|
</if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<resultMap id="CountStudentTrainDataDto" type="com.ym.mec.biz.dal.dto.CountStudentTrainDataDto">
|
|
|
<result property="trainNum" column="train_num_"/>
|
|
@@ -272,6 +276,9 @@
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
AND (mcr.create_time_ BETWEEN #{startTime} AND #{endTime} OR mcr.id_ IS NULL)
|
|
|
</if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
GROUP BY s.user_id_
|
|
|
ORDER BY total_play_time_ DESC
|
|
|
<include refid="global.limit"/>
|