StudentPlusMapper.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.StudentPlusMapper">
  4. <select id="userPage" resultType="com.ym.mec.biz.dal.wrapper.StudentWrapper$StudentList">
  5. select
  6. distinct s.user_id_ as studentId
  7. ,if(s.member_rank_setting_id_ is not null, true, false) as vipFlag,
  8. group_concat(sr.music_group_id_) as musicGroupIds
  9. from student s
  10. <if test="param.keyword != null and param.keyword != ''">
  11. left join sys_user su on su.id_ = s.user_id_
  12. </if>
  13. left join student_registration sr on sr.user_id_ = s.user_id_
  14. <where>
  15. sr.music_group_status_ in
  16. <foreach collection="param.statusList" close=")" item="status" open="(" separator=",">
  17. #{status}
  18. </foreach>
  19. <if test="param.keyword != null and param.keyword != ''">
  20. and (su.username_ like concat('%', #{param.keyword}, '%'))
  21. </if>
  22. <if test="param.musicGroupId != null and param.musicGroupId != ''">
  23. and sr.music_group_id_ = #{param.musicGroupId}
  24. </if>
  25. <if test="param.subjectId != null">
  26. and s.subject_id_list_ = #{param.subjectId}
  27. </if>
  28. <if test="param.cooperationOrganId != null">
  29. and s.cooperation_organ_id_ = #{param.cooperationOrganId}
  30. </if>
  31. <if test="param.studentId != null">
  32. and s.user_id_ = #{param.studentId}
  33. </if>
  34. <if test="param.vipFlag != null">
  35. <if test="param.vipFlag">
  36. and s.member_rank_setting_id_ is not null
  37. </if>
  38. <if test="param.vipFlag == false">
  39. and s.member_rank_setting_id_ is null
  40. </if>
  41. </if>
  42. </where>
  43. group by s.user_id_
  44. </select>
  45. </mapper>