CourseSchedulePlusMapper.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. from course_schedule cs
  13. left join music_group mg on mg.id_ = cs.music_group_id_
  14. <where>
  15. mg.del_flag_ = 0
  16. <if test="param.cooperationOrganId != null">
  17. and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
  18. </if>
  19. <if test="param.startTime != null">
  20. and cs.class_date_ &gt;= date_format(#{param.startTime}, '%Y-%m-%d')
  21. </if>
  22. <if test="param.endTime != null">
  23. and cs.class_date_ &lt;= date_format(#{param.endTime}, '%Y-%m-%d')
  24. </if>
  25. <if test="param.musicGroupId != null and param.musicGroupId != ''">
  26. and cs.music_group_id_ = #{param.musicGroupId}
  27. </if>
  28. </where>
  29. order by cs.class_date_ desc,cs.start_class_time_ desc,cs.id_ desc
  30. </select>
  31. <select id="teachingPointClass" resultType="com.ym.mec.biz.dal.wrapper.TeachingPointWrapper$ClassTeachingPoint">
  32. select
  33. cg.id_ as classGroupId
  34. ,cg.name_ as classGroupName
  35. ,mg.id_ as musicGroupId
  36. ,mg.name_ as musicGroupName
  37. ,cg.teaching_point_ as teachingPoint
  38. from class_group cg
  39. left join music_group mg on mg.id_ = cg.music_group_id_
  40. <where>
  41. and cg.del_flag_ = 0 and mg.del_flag_ = 0
  42. <if test="param.musicGroupId != null and param.musicGroupId != ''">
  43. and cg.music_group_id_ = #{param.musicGroupId}
  44. </if>
  45. <if test="param.cooperationOrganId != null">
  46. and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
  47. </if>
  48. <if test="param.musicGroupId != null">
  49. and cg.music_group_id_ = #{param.musicGroupId}
  50. </if>
  51. </where>
  52. order by cg.teaching_point_ is null desc,cg.id_ desc
  53. </select>
  54. </mapper>