|
@@ -211,22 +211,64 @@
|
|
|
SELECT COUNT(id_) FROM (
|
|
|
SELECT id_, create_time_,'EXERCISES' type_
|
|
|
FROM extracurricular_exercises
|
|
|
- WHERE teacher_id_ = #{teacherId} AND DATE_FORMAT(create_time_, '%Y-%m') = DATE_FORMAT(#{createTime}, '%Y-%m')
|
|
|
+ <where>
|
|
|
+ <if test="teacherId!=null">
|
|
|
+ AND teacher_id_ = #{teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null">
|
|
|
+ AND DATE_FORMAT(create_time_, '%Y-%m') = DATE_FORMAT(#{createTime}, '%Y-%m')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
UNION ALL
|
|
|
SELECT ch.id_,ch.create_time_,'HOMEWORK' type_ FROM course_homework ch
|
|
|
LEFT JOIN course_schedule_teacher_salary csts ON ch.course_schedule_id_ = csts.course_schedule_id_ AND csts.teacher_role_ = 'BISHOP'
|
|
|
- WHERE csts.user_id_ = #{teacherId} AND DATE_FORMAT(ch.create_time_, '%Y-%m') = DATE_FORMAT(#{createTime}, '%Y-%m')) h
|
|
|
+ <where>
|
|
|
+ <if test="teacherId!=null">
|
|
|
+ AND csts.user_id_ = #{teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="classGroupId!=null">
|
|
|
+ AND ch.class_group_id_=#{classGroupId}
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null">
|
|
|
+ AND DATE_FORMAT(ch.create_time_,'%Y-%m')=DATE_FORMAT(#{createTime}, '%Y-%m')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) h
|
|
|
</select>
|
|
|
<select id="findExtraExercilsesHomeworks" resultMap="ExtracurricularExercisesHomeworkListDto">
|
|
|
SELECT * FROM (
|
|
|
SELECT id_, create_time_,'EXERCISES' type_
|
|
|
FROM extracurricular_exercises
|
|
|
- WHERE teacher_id_ = #{teacherId} AND DATE_FORMAT(create_time_, '%Y-%m') = DATE_FORMAT(#{createTime}, '%Y-%m')
|
|
|
+ <where>
|
|
|
+ <if test="teacherId!=null">
|
|
|
+ AND teacher_id_ = #{teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null">
|
|
|
+ AND DATE_FORMAT(create_time_, '%Y-%m') = DATE_FORMAT(#{createTime}, '%Y-%m')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
UNION ALL
|
|
|
SELECT ch.id_,ch.create_time_,'HOMEWORK' type_ FROM course_homework ch
|
|
|
LEFT JOIN course_schedule_teacher_salary csts ON ch.course_schedule_id_ = csts.course_schedule_id_ AND csts.teacher_role_ = 'BISHOP'
|
|
|
- WHERE csts.user_id_ = #{teacherId} AND DATE_FORMAT(ch.create_time_, '%Y-%m') = DATE_FORMAT(#{createTime}, '%Y-%m')) h
|
|
|
+ <where>
|
|
|
+ <if test="teacherId!=null">
|
|
|
+ AND csts.user_id_ = #{teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="classGroupId!=null">
|
|
|
+ AND ch.class_group_id_=#{classGroupId}
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null">
|
|
|
+ AND DATE_FORMAT(ch.create_time_,'%Y-%m')=DATE_FORMAT(#{createTime}, '%Y-%m')
|
|
|
+ </if>
|
|
|
+ </where>) h
|
|
|
ORDER BY h.create_time_ DESC
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
|
+ <select id="findByIdList" resultMap="com.ym.mec.biz.dal.dao.CourseHomeworkDao.teacherHomeworkListDto">
|
|
|
+ SELECT id_,title_,content_,completed_num_,expect_num_,music_score_id_,expire_date_,DATE_FORMAT(create_time_,'%Y-%m-%d') 'day_'
|
|
|
+ FROM extracurricular_exercises WHERE id_ IN
|
|
|
+ <foreach collection="exercisesIdList" separator="," item="item" open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
</mapper>
|