CourseSchedulePlusMapper.xml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.ym.mec.biz.dal.mapper.CourseSchedulePlusMapper">
  4. <select id="teachingPointCourse" resultType="com.ym.mec.biz.dal.wrapper.TeachingPointWrapper$CourseTeachingPoint">
  5. select cs.id_ as courseId
  6. ,cs.name_ as courseName
  7. ,cs.status_ as courseStatus
  8. ,mg.id_ as musicGroupId
  9. ,mg.name_ as musicGroupName
  10. ,cs.actual_teacher_id_ as teacherId
  11. ,cs.teaching_point_ as teachingPoint
  12. ,cs.class_date_ as courseDate
  13. ,cs.start_class_time_ as startClassTime
  14. ,cs.end_class_time_ as endClassTime
  15. from course_schedule cs
  16. left join music_group mg on mg.id_ = cs.music_group_id_
  17. <where>
  18. mg.del_flag_ = 0
  19. <if test="param.courseStatus != null">
  20. and cs.status_ = #{param.courseStatus}
  21. </if>
  22. <if test="param.cooperationOrganId != null">
  23. and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
  24. </if>
  25. <if test="param.startTime != null">
  26. and cs.class_date_ &gt;= date_format(#{param.startTime}, '%Y-%m-%d')
  27. </if>
  28. <if test="param.endTime != null">
  29. and cs.class_date_ &lt;= date_format(#{param.endTime}, '%Y-%m-%d')
  30. </if>
  31. <if test="param.musicGroupId != null and param.musicGroupId != ''">
  32. and cs.music_group_id_ = #{param.musicGroupId}
  33. </if>
  34. </where>
  35. order by cs.class_date_ desc,cs.start_class_time_ desc,cs.id_ desc
  36. </select>
  37. <select id="teachingPointClass" resultType="com.ym.mec.biz.dal.wrapper.TeachingPointWrapper$ClassTeachingPoint">
  38. select
  39. cg.id_ as classGroupId
  40. ,cg.name_ as classGroupName
  41. ,mg.id_ as musicGroupId
  42. ,mg.name_ as musicGroupName
  43. ,cg.teaching_point_ as teachingPoint
  44. from class_group cg
  45. left join music_group mg on mg.id_ = cg.music_group_id_
  46. <where>
  47. and cg.del_flag_ = 0 and mg.del_flag_ = 0
  48. <if test="param.musicGroupId != null and param.musicGroupId != ''">
  49. and cg.music_group_id_ = #{param.musicGroupId}
  50. </if>
  51. <if test="param.cooperationOrganId != null">
  52. and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
  53. </if>
  54. <if test="param.musicGroupId != null">
  55. and cg.music_group_id_ = #{param.musicGroupId}
  56. </if>
  57. </where>
  58. order by cg.teaching_point_ is null desc,cg.id_ desc
  59. </select>
  60. </mapper>