CourseTable.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xjrsoft.module.courseTable.mapper.CourseTableMapper">
  6. <select id="getList" parameterType="com.xjrsoft.module.schedule.dto.CourseTableDto" resultType="com.xjrsoft.module.schedule.vo.CourseDetailVo">
  7. SELECT t1.course_name, t1.teacher_name,CONCAT(t4.name,t3.name) AS classroom_name,t1.weeks,t1.time_period,t1.time_number,t5.name as class_name,t1.schedule_date,t1.adjust_type FROM course_table t1
  8. LEFT JOIN base_classroom t3 ON t1.site_id = t3.id
  9. LEFT JOIN base_office_build t4 ON t3.office_build_id = t4.id
  10. LEFT JOIN base_class t5 ON t1.class_id = t5.id
  11. LEFT JOIN base_class_major_set t7 ON t7.class_id = t5.id
  12. LEFT JOIN base_grade t6 ON t5.grade_id = t6.id
  13. where t1.status = 1
  14. <if test="dto.semesterId != null">
  15. and t1.base_semester_id = #{dto.semesterId}
  16. </if>
  17. <if test="dto.weekDay != null">
  18. and t1.weeks = #{dto.weekDay}
  19. </if>
  20. <if test="dto.courseType != null and dto.courseType != '' and dto.courseType == 'teacher' and dto.teacherId != null">
  21. and t1.teacher_id like concat('%', #{dto.teacherId}, '%')
  22. </if>
  23. <if test="dto.courseType != null and dto.courseType != '' and dto.courseType == 'class'">
  24. <if test="dto.gradeId != null">
  25. and t6.id = #{dto.gradeId}
  26. </if>
  27. <if test="dto.classId != null">
  28. and t5.id = #{dto.classId}
  29. </if>
  30. <if test="dto.majorSetId != null">
  31. and t7.major_set_id = #{dto.majorSetId}
  32. </if>
  33. </if>
  34. <if test="dto.startDate != null and dto.endDate != null">
  35. and t1.schedule_date between #{dto.startDate} and #{dto.endDate}
  36. </if>
  37. <if test="dto.toDay != null">
  38. and t1.schedule_date = #{dto.toDay}
  39. </if>
  40. <if test="dto.teacherId != null">
  41. and t1.teacher_id like concat('%', #{dto.teacherId}, '%')
  42. </if>
  43. <if test="dto.classId != null">
  44. and t5.id = #{dto.classId}
  45. </if>
  46. </select>
  47. <select id="getAdjustList" parameterType="com.xjrsoft.module.schedule.dto.CourseTableAdjustDto" resultType="com.xjrsoft.module.schedule.vo.CourseListVo">
  48. SELECT t1.time_period,t1.time_number,t1.course_name,t2.name AS class_name,t3.name AS classroom_name,t1.id,t2.id as class_id FROM course_table t1
  49. LEFT JOIN base_class t2 ON t1.class_id = t2.id
  50. LEFT JOIN base_classroom t3 ON t1.site_id = t3.id
  51. WHERE t1.status = 1 AND t1.teacher_id = #{dto.teacherId}
  52. AND t1.weeks = #{dto.week} AND t1.schedule_date = #{dto.adjustDate}
  53. <if test="dto.classId != null and dto.classId != ''">
  54. and t1.class_id = #{dto.classId}
  55. </if>
  56. </select>
  57. <select id="getClassListByTeacherId" parameterType="com.xjrsoft.module.schedule.dto.ClassOptionDto" resultType="com.xjrsoft.module.schedule.vo.ClassOptionVo">
  58. SELECT id,name FROM base_class WHERE delete_mark = 0 AND id IN (
  59. SELECT DISTINCT class_id FROM course_table WHERE teacher_id = #{dto.userId}
  60. )
  61. </select>
  62. </mapper>