ClassTimeStatisticsMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.classtime.mapper.ClassTimeStatisticsMapper">
  6. <select id="getTeacherList" resultType="com.xjrsoft.module.classtime.vo.TeacherListVo">
  7. SELECT t1.id,t1.name,t2.employ_type FROM xjr_user t1
  8. INNER JOIN base_teacher t2 ON t1.id = t2.user_id
  9. WHERE t1.delete_mark = 0 AND t2.employ_type IN ('FB1601','FB1605','FB1609')
  10. </select>
  11. <select id="getWfTeacherCourseTimeList" parameterType="com.xjrsoft.module.classtime.entity.ClassTimeStatistics" resultType="com.xjrsoft.module.oa.entity.WfTeacherCourseTime">
  12. SELECT t1.* FROM wf_teacher_course_time t1
  13. INNER JOIN xjr_workflow_form_relation t2 ON t1.id = t2.form_key_value
  14. WHERE t2.current_state = 'COMPLETED'
  15. and t1.schedule_date BETWEEN #{dto.startDate} and #{dto.endDate}
  16. </select>
  17. <select id="getCourseList" parameterType="com.xjrsoft.module.classtime.entity.ClassTimeStatistics" resultType="com.xjrsoft.module.classtime.vo.CourseListVo">
  18. SELECT t1.class_id, t1.teacher_id, t2.short_name,t1.adjust_type,t4.reason,t1.schedule_date,t1.class_name,t1.course_name FROM course_table t1
  19. LEFT JOIN class_time t2 ON t1.time_period = t2.time_period AND t1.time_number = t2.number
  20. LEFT JOIN course_table_bak t3 ON t1.id = t3.id
  21. LEFT JOIN wf_course_adjust t4 ON t4.id = t3.wf_course_adjust_id
  22. WHERE t1.schedule_date BETWEEN #{dto.startDate} and #{dto.endDate}
  23. AND t1.schedule_date NOT IN (
  24. SELECT DATE FROM holiday_date WHERE STATUS = 3
  25. AND DATE BETWEEN #{dto.startDate} and #{dto.endDate}
  26. )
  27. </select>
  28. <select id="getHolidayReplaceCourseList" parameterType="com.xjrsoft.module.classtime.entity.ClassTimeStatistics" resultType="com.xjrsoft.module.classtime.vo.CourseListVo">
  29. SELECT t1.class_id, t1.teacher_id, t2.short_name,t1.adjust_type,t4.reason,t1.schedule_date,t1.class_name,t1.course_name FROM course_table t1
  30. LEFT JOIN class_time t2 ON t1.time_period = t2.time_period AND t1.time_number = t2.number
  31. LEFT JOIN course_table_bak t3 ON t1.id = t3.id
  32. LEFT JOIN wf_course_adjust t4 ON t4.id = t3.wf_course_adjust_id
  33. WHERE t1.schedule_date BETWEEN #{dto.startDate} and #{dto.endDate}
  34. AND t1.adjust_type = 'course_replace'
  35. AND t1.schedule_date IN (
  36. SELECT DATE FROM holiday_date WHERE STATUS = 3
  37. AND DATE BETWEEN #{dto.startDate} and #{dto.endDate}
  38. )
  39. </select>
  40. <select id="getReplaceCourseList" parameterType="com.xjrsoft.module.classtime.entity.ClassTimeStatistics" resultType="com.xjrsoft.module.classtime.vo.CourseListVo">
  41. SELECT t1.class_id, t1.teacher_id, t2.short_name,t1.adjust_type,t4.reason,t1.schedule_date FROM course_table t1
  42. LEFT JOIN class_time t2 ON t1.time_period = t2.time_period AND t1.time_number = t2.number
  43. LEFT JOIN course_table_bak t3 ON t1.id = t3.id
  44. LEFT JOIN wf_course_adjust t4 ON t4.id = t3.wf_course_adjust_id
  45. WHERE t1.schedule_date BETWEEN #{dto.startDate} and #{dto.endDate}
  46. AND t1.schedule_date IN (
  47. SELECT replace_date FROM class_time_calendar WHERE delete_mark = 0 AND replace_date BETWEEN #{dto.startDate} and #{dto.endDate}
  48. )
  49. </select>
  50. <select id="getSubstituteList" parameterType="com.xjrsoft.module.classtime.entity.ClassTimeStatistics" resultType="com.xjrsoft.module.classtime.vo.CourseListVo">
  51. SELECT t4.short_name,t3.schedule_date,t3.class_id,t1.user_id as teacher_id,t1.exchange_teacher_id,t1.reason FROM wf_course_adjust t1
  52. INNER JOIN xjr_workflow_form_relation t2 ON t1.id = t2.form_key_value
  53. INNER JOIN course_table_bak t3 ON t1.id = t3.wf_course_adjust_id
  54. LEFT JOIN class_time t4 ON t3.time_period = t4.time_period AND t3.time_number = t4.number
  55. WHERE t1.delete_mark = 0 AND t2.current_state = 'COMPLETED'
  56. <!-- AND t1.reason IN ('sick_leave','leave_absence') -->
  57. and t1.adjust_type = 'course_substitute'
  58. AND t3.schedule_date BETWEEN #{dto.startDate} and #{dto.endDate}
  59. AND t3.schedule_date NOT IN (
  60. SELECT DATE FROM holiday_date WHERE STATUS = 3
  61. AND DATE BETWEEN #{dto.startDate} and #{dto.endDate}
  62. )
  63. </select>
  64. <select id="getRecordList" resultType="com.xjrsoft.module.classtime.vo.ClassTimeStatisticsRecordVo">
  65. SELECT t1.id,t2.user_name,t2.name,t3.name AS employ_type_cn,t1.week_data,
  66. t1.class_time1,t1.class_time2,t1.class_time3,t1.class_time4,t1.class_time5,
  67. t1.class_time6,t1.class_time7,t1.class_time8,t1.class_time9,t1.class_time10,t1.class_time11,
  68. t1.all_class_time,t1.total_amount,t1.class_time_amount,t1.beyond_class_time_amount FROM class_time_statistics_record t1
  69. INNER JOIN xjr_user t2 ON t1.user_id = t2.id
  70. LEFT JOIN xjr_dictionary_detail t3 ON t1.employ_type = t3.code
  71. WHERE t1.delete_mark = 0 AND t1.class_time_statistics_id = #{id}
  72. </select>
  73. </mapper>