CourseTable.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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, t2.name AS 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 FROM course_table t1
  8. LEFT JOIN xjr_user t2 ON t1.teacher_id = t2.id
  9. LEFT JOIN base_classroom t3 ON t1.site_id = t3.id
  10. LEFT JOIN base_office_build t4 ON t3.office_build_id = t4.id
  11. LEFT JOIN base_class t5 ON t1.class_id = t5.id
  12. LEFT JOIN base_class_major_set t7 ON t7.class_id = t5.id
  13. LEFT JOIN base_grade t6 ON t5.grade_id = t6.id
  14. where t1.status = 1
  15. <if test="dto.semesterId != null">
  16. and t1.base_semester_id = #{dto.semesterId}
  17. </if>
  18. <if test="dto.weekDay != null">
  19. and t1.weeks = #{dto.weekDay}
  20. </if>
  21. <if test="dto.courseType != null and dto.courseType != '' and dto.courseType == 'teacher'">
  22. <if test="dto.teacherId != null ">
  23. and t1.teacher_id = #{dto.teacherId}
  24. </if>
  25. </if>
  26. <if test="dto.courseType != null and dto.courseType != '' and dto.courseType == 'class'">
  27. <if test="dto.gradeId != null">
  28. and t6.id = #{dto.gradeId}
  29. </if>
  30. <if test="dto.classId != null">
  31. and t5.id = #{dto.classId}
  32. </if>
  33. <if test="dto.majorSetId != null">
  34. and t7.major_set_id = #{dto.majorSetId}
  35. </if>
  36. </if>
  37. <if test="dto.startDate != null and dto.endDate != null">
  38. and t1.schedule_date between #{dto.startDate} and #{dto.endDate}
  39. </if>
  40. <if test="dto.toDay != null">
  41. and t1.schedule_date = #{dto.toDay}
  42. </if>
  43. <if test="dto.teacherId != null">
  44. and t1.teacher_id = #{dto.teacherId}
  45. </if>
  46. <if test="dto.classId != null">
  47. and t5.id = #{dto.classId}
  48. </if>
  49. </select>
  50. <select id="getAdjustList" parameterType="com.xjrsoft.module.schedule.dto.CourseTableAdjustDto" resultType="com.xjrsoft.module.schedule.vo.CourseListVo">
  51. 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
  52. LEFT JOIN base_class t2 ON t1.class_id = t2.id
  53. LEFT JOIN base_classroom t3 ON t1.site_id = t3.id
  54. WHERE t1.status = 1 AND t1.teacher_id = #{dto.teacherId}
  55. AND t1.weeks = #{dto.week} AND t1.schedule_date = #{dto.adjustDate}
  56. <if test="dto.classId != null and dto.classId != ''">
  57. and t1.class_id = #{dto.classId}
  58. </if>
  59. </select>
  60. </mapper>