|
@@ -4182,9 +4182,55 @@
|
|
|
<if test="param.versionTag !=null">
|
|
|
and ch.version_tag_ = #{param.versionTag}
|
|
|
</if>
|
|
|
+
|
|
|
+ <if test="param.teacherId != null">
|
|
|
+ and cs.teacher_id_ = #{param.teacherId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
<if test="param.offset != null">
|
|
|
limit #{param.offset},#{param.rows}
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="countTeacherServeHomeworkDetailV2" resultType="int">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ from course_schedule cs
|
|
|
+ left join course_homework ch on cs.id_ = ch.course_schedule_id_
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test="param.teacherId != null">
|
|
|
+ and cs.teacher_id_ = #{param.teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="param.musicGroupId != null">
|
|
|
+ and #{param.musicGroupId} = cs.music_group_id_
|
|
|
+ </if>
|
|
|
+ <if test="param.classType != null">
|
|
|
+ and cs.type_ = #{param.classType}
|
|
|
+ </if>
|
|
|
+ <if test="param.homeWorkStatus != null">
|
|
|
+ <if test="param.homeWorkStatus.code == 'UNASSIGNED'">
|
|
|
+ and ch.id_ is null
|
|
|
+ </if>
|
|
|
+ <if test="param.homeWorkStatus.code == 'ASSIGNED'">
|
|
|
+ and ch.id_ is not null
|
|
|
+ </if>
|
|
|
+ <if test="param.homeWorkStatus.code == 'DEADLINE'">
|
|
|
+ and ch.id_ is not null and ch.expiry_date_ < now()
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="courseIds != null and courseIds.size() != 0">
|
|
|
+ and cs.id_ in
|
|
|
+ <foreach collection="courseIds" item="courseId" open="(" separator="," close=")">
|
|
|
+ #{courseId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="param.courseScheduleId != null">
|
|
|
+ and cs.id_ = #{param.courseScheduleId}
|
|
|
+ </if>
|
|
|
+ <if test="param.versionTag !=null">
|
|
|
+ and ch.version_tag_ = #{param.versionTag}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|